home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD2.mdf
/
c
/
library
/
mslang
/
par
/
example4.pom
< prev
next >
Wrap
Text File
|
1993-10-07
|
3KB
|
70 lines
; The following comment lines are for quick-reference.
; Copy them into your own POM files to make programming easier.
;
; COMMAND FORMATS EXAMPLES
; --------------- --------
; MINLEN number MINLEN "15"
; SET var1 value1 SET NAME $FLINE[20 26]
; IGNORE value1 value2 IGNORE PRICE "0.00"
; ACCEPT value1 value2 ACCEPT $FLINE[1 3] "YES"
; IF value1 value2 var1 value3 [value4] IF PRICE "0.00" BONUS "1.00"
; TRIM var1 spec1 character TRIM PRICE "R" "$"
; PAD var1 spec1 character len PAD SERIALNUM "L" "0" "10"
; INSERT var1 spec1 value1 INSERT PRICE "L" "$"
; CHANGE var1 value1 value2 CHANGE DATE "/" "--"
; OUT value1 value2 |output-picture OUT "X" "X" |{PRICE}
; OUTEND value1 value2 |output-picture OUTEND "X" "X" |{$FLINE}
;
; 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 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}