home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 25
/
CD_ASCQ_25_1095.iso
/
dos
/
tools
/
par330
/
exampl04.pom
< prev
next >
Wrap
Text File
|
1995-09-06
|
6KB
|
116 lines
; The following comment lines are for quick-reference.
; You can copy them into your own POM files to make programming easier.
;
; In the table below:
;
; "var" means a variable that is being set.
; "c" means a comparator (if omitted, defaults to "equals")
; "value" means a variable whose value is being read.
; Square brackets [like this] indicate optional items.
;
; ------------------------------------------- ------------------------------
; COMMAND FORMATS EXAMPLE
; ------------------------------------------- ------------------------------
; ACCEPT value c value ACCEPT $FLINE[1 3] = "YES"
; APPEND var value value [value [value]] APPEND name first last
; BEGIN value c value BEGIN linecntr < "3"
; CALCREAL var value operation value CALCREAL salary hours "*" rate
; CALC var value oepration value CALC total total "+" sold
; CHANGE var value value CHANGE date "/" "-"
; CHOP from to [,from to] [...] CHOP 1 250, 251 300
; DONE [value c value] DONE $FLINE = "End Data"
; ELSE ELSE
; EPILOGUE EPILOGUE
; END END
; HALT value c value value [value] HALT x = y "Item repeated"
; IF value c value var value [value] IF x = "Y" THEN z = "N"
; IGNORE value c value IGNORE price = "0.00"
; INSERT var spec value INSERT price "L" "$"
; LOG value c value value LOG x = y "Item repeated"
; LOOKCOLS value value value value LOOKCOLS "1" "3" "8" "255"
; LOOKFILE value LOOKFILE "C:\TABLES\DATA.TBL"
; LOOKSPEC value value value LOOKSPEC "Y" "N" "N"
; LOOKUP var value LOOKUP phonenum "FRED JONES"
; MINLEN value [value] MINLEN "15"
; NEXTFILE [value c value] NEXTFILE $FLINE = "End File"
; OUT [value c value] |output-picture OUT z = "X" |{price}
; OUTEND [value c value] |output-picture OUTEND z = "X" |{$FLINE}
; OUTHDG value OUTHDG "LIST OF EMPLOYEES"
; PAD var spec character len PAD sernum "L" "0" "10"
; PAGELEN value [value] PAGELEN "66" "N"
; PARSE var value from to [control] PARSE x $FLINE "2*(" "3*)"
; PEEL var var from to [control] PEEL x $FLINE "2*(" "3*)"
; PROPER var [methods [exceptions-file]] PROPER custname "I" "XY.PEF"
; PROLOGUE PROLOGUE
; READNEXT [value c value] READNEXT $FLINE[1 5] = "NOTE:"
; SET var value SET name $FLINE[20 26]
; SETLEN var value SETLEN length custname
; SOUND value SOUND "BUZZ"
; SPLIT from to [,from to] [...] SPLIT 1 250, 251 300
; TRACE var TRACE price
; TRIM var spec character TRIM price "R" "$"
; ------------------------------------------- ------------------------------
;
; DEFAULT VALUES
;
; LOOKCOLS: Keyfield Start = 1, End = 10; Datafield Start = 12, End = 255
; LOOKFILE: No default, but you can set the file name via the /L parameter
; LOOKSPEC: Trim = Yes; Sorted = No; Case-sensitive = No
; MINLEN: Normal reading (value1) = "1"; READNEXT (value2) = "0"
; PAGELEN: 0
; PROPER: Methods: "IW"
;
; ---------------------------------------------------------------------------
;
; PADDING FOR CLARITY
;
; Before: IF PRICE "0.00" BONUS "1.00" "0.00
; After: IF PRICE = "0.00" THEN BONUS = "1.00" ELSE "0.00
;
;******************************************************************************
;
; Restrict the lines we'll accept
;
ACCEPT $FLINE[58 60] = "IBM"
ACCEPT $FLINE[58 60] = "MAC"
;
; Pad out description, with spaces, to 40 characters
; We'll also modify the string -PC to read -IBMPC
; Note the trailing space after PC to ensure it's at the end of the string
;
SET descrip = $FLINE[19 49]
INSERT descrip "@PC " "IBM"
PAD descrip "R" " " "40"
;
; Make quantity only 2 characters wide (maximum would therefore be 99)
;
SET qty = $FLINE[63 66]
TRIM qty "A" " "
PAD qty "L" " " "2"
;
; Take only the last three digits of the invoice number
;
SET inv = $FLINE[14 16]
;
; Detect minus sign and set price accordingly
;
SET price = $FLINE[70 76]
TRIM price "A" " "
IF $FLINE[77] = "-" THEN minus = "-" ELSE ""
INSERT price "L" minus
PAD price "L" " " "7"
INSERT price "L" "$"
;
; Set other fields; note use of uppercase version of $FLINE ($FLUPC) for type
;
SET itemnum = $FLINE[01 07]
SET type = $FLUPC[51 55]
SET cat = $FLINE[58 60]
;
; Set output as follows:
; Invoice, Item, Type (in uppercase), Category
; Description, Quantity, Unit price
;
OUT |{inv} {itemnum} {type} {cat}
OUTEND | {descrip} {qty} {price}