! LISTIT.LGC - Program to list forsale items
!              R Lucas  011216
!              Execution:  start/w winfics flogic l: listit

ACTIVATE = FORSALE

DECLARE More = %A80
        Mail = %A80
;

OPEN (1,LIST) = "forsale.htm"
WRITE (1) = "<title>LUCASCO - FOR SALE</title>"
CLOSE (1)

IOPEN = "FORSALE"
IF _ERR_ = 1 THEN
   MESSAGE = "Unable to open FORSALE"
   STOP
ELSE
   DO 10 FOREVER
      READNXT = "FORSALE"
      IF _ERR_ = 1 THEN EXIT 10 ;
      IF Status = "SOLD" THEN NEXT 10 ;
      IF Link = _BLANK_ THEN
         More = "no"
      ELSE
         More = Link // "YES</a>"
         SQUEEZE1 = More
         More = SQUEEZE1
      ENDIF
      IF Order = _BLANK_ THEN
         Order_it = _BLANK_
      ELSE
         Order_it = "<a href=mailto:randy@lucasco.info>Yes</a>"
      ENDIF
      LIST = "For Sale"
             Category * 
	     Item     *
	     Descrip  *
	     Price    *
	     More     *
	     Status   *
	     Order_it
	     /HTML
	     /OUTPUT=forsale.htm
	     /SKIP=Category
      ;
   END 10
   ICLOSE = "FORSALE"
ENDIF

FINISH
