HelpPages

Home | Developer | Introduction | Basic Structures

Basic Structures

    BASIC STRUCTURES

DOCPARAMS. This basic structure defines the basic data for a document. The syntax is:
[DEVICE [/LP=H] [/WD=W] [/ST=S]] FILENAME

    FILENAME: Filename document (. PDC). This parameter is required.
    DEVICE: Output Device. May be one of the following:
        COMn: baud, p, bits, stop
        LPTn:
        \\Server\share
        Filename.txt
        Filename.pdf
    /LP=n    n defines the length of the page.
    /WD=n    n defines the width of the page.
    /ST=n    n defines the pass line.

Example:
    "COM1:9600,N,8.1 /LP=48 /WD=24,ALBARAN.PDC'

Note: See introduction to documents to use USB devices.

DOCSETS. This structure allows to define expressions that modify the standard behavior of the Document Processor. Its syntax is:
    [ONCEINIEXP], [DOCINIEXP], [DOCCONTINUE], [DOCLOOPCOND]

    ONCEINIEXP will run only once at the start of processing.
    DOCINIEXP will run once each document.
    DOCCONTINUE This is use as evaluator to test final when processing multiple documents.
    DOCLOOPCOND Indicates a selection condition instead of the parameter /COND $

Example: "TYPE{}=='NEW',AGENT{}>5,DATE{}=='2010 331'"

SELECTPARMS. This structure is used to initialize tables or open files. It is used in the screen parameter OPEN$ and in the SELECT command in scripts. The opening parameter is a string of comma separated subparameters and consistent in the table ID or file number, followed by a semicolon and the level of opening: 1 read only, 2 reading and writing. The newest member of the sequence becomes the default table or file. If the parameter is 'RESTORE' restores the state of files. When using OPEN$, restoration is automatic when you close the screen. At the end of a script, also restores the previous state, but it is good programming practice to restore expressly.

Example: 'items;1,Movements;2'
Example: '3;2,4;2,5;1 '

FILESTRUCT. This structure is used to define the fields for a file. These parameters are in the form "FIELD;L;T,FIELD;L;T. .." where FIELD is the field name, L the length and T the type.
Example: "CODE;8;N,ITEM_DESCR;35,;A,PRICE;7;2"

INDEXSTRUCT. This structure defines the indexes of a file. Each comma separated parameter is an index and must be enclosed between <..>. Each index takes a substring of OOOOLLL format, where O is the offset in 1 base and L the length.
Example: "<   1  8  10  2>, <   9  2>". The index is formed with a substring of the buffer over 1.8 10.2, while the second substring index is 9.2.

SCANMODE. This structure defines a way to scan, and optionally supports other parameters:
"MODE [/FILE=n] [/INDEX=n] [/FROM=iKey$] [/TO=lkey$]".
    MODE can be ACUM or EXPVAL.
    /FILE file defines the data source.
    /INDEX defines the index to use.
    /FROM keyword defines the initial search.
    /TO defines the key end of the process.