home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-25 | 48.4 KB | 1,478 lines |
- VP-Info Level 1 Reference Manual Page 381 SECTION 4
-
-
- TEXT
-
-
- Send text to screen or printer.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ TEXT [<file>/.<volume>/M.<memo>] ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Options: ║
- ║ ║
- ║ <file> the name of the text file to use ║
- ║ <volume> the number of a volume in the current library; a ║
- ║ numeric constant ║
- ║ <memo> the name of a memo field in the current data file ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- The TEXT command has two forms. The first form is the
- TEXT/ENDTEXT program structure:
-
- TEXT
- <text>
- ENDTEXT
-
- All lines following the TEXT command up to ENDTEXT are displayed
- on the screen or if the command SET PRINT ON was given, then also sent
- to the printer.
-
- The second form is:
-
- TEXT <file>/.<volume>/M.<memo>
-
- where the text is taken from the file <file> (default extension TXT),
- from the numbered volume in the current library (see SET LIBRARY TO
- command), or from a memo in a data file. This is the same as
-
- TEXT
- the text from <file> or <volume> or <memo>
- ENDTEXT
-
- The second form is preferable in many circumstances, since it:
-
- 1. Keeps the size of the program module down
-
- 2. Allows manipulation of the text in <file>, <volume>
- or <memo>
-
- 3. Allows the choice of text to be used, since <file> can
- be a macro, and <volume> can be a numeric expression. In
- the case of memos, every recored can have different text.
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 382 SECTION 4
-
-
- Note that library volumes are addressed by placing a period in
- front of the volume number, which can be either a numeric constant or
- a numeric expression. Memos are addressed by preceding the field name
- with "M." Do not confuse this usage of periods with a decimal point.
-
- TEXT macros.
-
- Contents of fields and variables can be merged into text blocks
- for data input, reporting, listing and mail-merge applications.
- VP-Info Level 1 provides four special macro symbols for this purpose
- as follows:
- Fixed position Floating position
- Input macros (display/edit) @ %
- Output macros (display only) # &
-
- When a text macro symbol is encountered, VP-Info Level 1 does the
- following:
-
- 1. Checks whether the following characters are the name of
- a field in the selected file. If it is, the current
- contents of the field replaces &<var> in the text.
-
- 2. If not a field name, then the characters following the
- macro symbol are assumed to be a memory variable name.
- If that name is valid, the contents of the memory
- variable replaces <var> in the text.
-
- 3. If <var> is neither a field nor a variable, it is
- assumed not to be a macro, and both the macro symbol
- and <var> are output as a literal.
-
- When the macro symbol & is used and SET TRIM ON, <var> is trimmed
- before it is merged. The position of all text to the right of <var>
- in the same line is adjusted so that the number of spaces after <var>
- in the output is the same as in the TEXT, no matter how wide <var> is.
-
- Caution: In a TEXT macro, <variable> must be terminated by
- blank, tab, punctuation mark, or a macro symbol; it cannot be
- terminated by a graphics character (since in many non-English
- character sets these characters are normal or accented
- alphanumeric characters). It also cannot be terminated by a
- colon or an underscore, since these are valid parts of a field or
- variable name.
-
- Output (list processing).
-
- This command can be used to do list processing.
-
- Any variable (field, memory variable, or system variable) can be
- merged into the document and output by using &<var> or #<var> in the
- text.
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 383 SECTION 4
-
-
-
- As described above, the & macro will trim the contents of <var>
- when output when SET TRIM ON, and always adjusts the material to its
- right on the same line depending on the width of the contents of
- <var>. Sometimes, it is more useful to output at an absolute location
- with a variable (as opposed to merging); to do this use the #<var>
- form. #<var> does not trim or adjust the position of other items on
- the line, creating the possibility that later items in the line may be
- overwritten.
-
- A paragraph is a portion of the text between two carriage returns
- (obtained by hitting <ENTER>). A paragraph is formatted by the TEXT
- command using word wrap (if there is not enough room for a word on a
- line, it is displayed/printed at the start of the next line). The
- page width and the left margin are set by the SET WIDTH and the SET
- MARGIN commands (see SET WIDTH and SET MARGIN).
-
- Control codes can be sent from the text using the symbols ^
- (caret) and \ (backslash).
-
- The caret. When VP-Info Level 1 comes across a ^, it checks for
- the next character. If the next character is also a ^, the two
- characters are sent as a single ^. If the next character is not a ^,
- it is sent as a control character; for instance, ^C is sent as Ctrl-C.
-
- Examples for ^:
-
- ^^ sent as ^
- ^C sent as Ctrl-C
- ^^C sent as ^C
-
- The backslash. When VP-Info Level 1 comes across a \, it checks
- for the next character. If the next character is also a \, the two
- characters are sent as a single \. If the next character is not a \,
- VP-Info Level 1 checks for digits; it grabs as many digits as there
- are, up to three. The digits are converted into a number, and the
- number is sent as a code between 0 and 255.
-
- Examples for \:
-
- \\ sent as \
- \2a sent as code 2, followed by a
- \0020 sent as code 2, followed by the character 0 (002 is
- the 2)
- \27x\000 sent as code 27 (escape), x, code 0
-
- Examples:
-
- TEXT
- This text will be sent to the screen or the printer. You can set the<
-
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 384 SECTION 4
-
-
- left margin and the text width. The text is automatically word<
- wrapped.
- ENDTEXT
-
- Now the same in letter quality mode on the Epson LQ-1500 printer:
-
- TEXT
- \27x\001This text will be sent to the screen or the printer. You can<
- set the left margin and the text width. The text is automatically<
- word wrapped.
- ENDTEXT
-
- Input screen painting.
-
- The TEXT command can be used "to paint" input screens. @<var> is
- a GET, activated by a READ command.
-
- @<var> also has a floating-position form, %<var>, which adjusts
- the material to its right on the same line depending on the width of
- the contents of <var>.
-
- Neither @<var> nor %<var> trims the present contents of the
- variable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 385 SECTION 4
-
-
- Examples:
-
- TEXT
- @fname @name @dept
- ENDTEXT
-
- TEXT
- %fname %name %dept
- ENDTEXT
-
- Both create a one-line input format that can be used with BROWSE OFF
- (or, if the macro line is placed in a text file, with BROWSE TEXT.
- The second form is easier to use, since there is no concern about the
- width of the various fields. For example, the maximum width available
- for NAME in the first form is 20 characters; if it is 20, it runs into
- DEPT, and if more than 20, it will suppress DEPT input completely.
-
- Formats in TEXT.
-
- TEXT formats let you control the display on fields and variables
- used in TEXT macros. They are similar to the formats used in the
- PICTURE and USING clauses of the @ command (see @ for format rules and
- examples).
-
- In TEXT blocks and files, formats must appear at the beginning of
- the block, with a separate line for each formatted variable. Each
- line must begin with two periods and a space, followed by the name of
- the field or variable, a comma, and the format picture. Examples:
-
- .. cust,!!!!-!-99
- .. today,99/99/99
- .. balance,$$$$$$$$$9,99>
- .. price,$$,$$$.99
- .. codes#3,' xxx xxx xxx '
- .. exception,'First: "xxxxxxxxxx"'
-
- Format lines may not contain comments, and need no quote marks
- unless the format itself includes leading or trailing blanks (not
- recommended) or quote marks of the other type; see last two example
- above.
-
- If a field is not in the selected data file, be sure to use field
- redirection as in CODES#3 above.
-
- Effect of SET TEXT ON/OFF and CLEAR GETS.
-
- A Get Table with room for up to 64 gets is available for full-
- screen editing commands, like READ, EDIT, and BROWSE. Whenever a GET
- is issued (either by TEXT or @ GET), it is entered into the Get Table
- so that VP-Info Level 1 can rapidly ascertain its position and format
-
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 386 SECTION 4
-
-
- during later processing.
-
- When SET TEXT ON, the TEXT display macros created with & and #
- are put into the Get Table. This setting is usually required for input
- screens created with TEXT.
-
- When SET TEXT OFF, display macros are not put into the Get Table.
- This setting is required when using TEXT for printer output, as in
- mail-merge programs, to avoid trying to create a 65th entry in the Get
- Table. Over-filling the Get Table is an error that causes termination
- of a program.
-
- It is good practice to place a CLEAR GETS command before the TEXT
- command to ensure that the Get Table is empty before starting to fill
- it again.
-
- Examples:
-
- 1. A text file used in data input with EDIT TEXT (see screen
- output in EDIT command section):
-
- .. zip,!9! 9!9
- .. phone,999-9999 (999)
- .. wphone,999-9999 (999)
- .. training,99/99
-
- NAME........... %FNAME %NAME
-
- ADD_1.......... %ADD_1 %AREA
- ZIP............ @ZIP
-
- PHONE.......... @PHONE
- WPHONE......... @WPHONE
-
- EXPERIENCE.....
- @EXPERIENCE
- COMMENTS
- @COMMENT1
- @COMMENT2
-
- 2. A program that does formatted output from a data file,
- including multi-line output from certain fields:
-
- SET PRINT ON
- SET TEXT OFF
- SET MARGIN TO 0
- SET WIDTH TO 80
- IF row()>1 ;if current row not at top of form,
- SPOOL junk ; eject into throw-away spool file
- EJECT
- SPOOL
- ENDIF
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 387 SECTION 4
-
-
- USE customer INDEX customer
- page=1
- PERFORM heading
- DO WHILE .not. eof
- IF ROW()>50 ;start new page if past line 50
- EJECT
- PERFORM heading
- ENDIF
- nameline=TRIM(fname)+' '+TRIM(name)
- address=TRIM(addr:1)+' '+TRIM(addr:2)+' '+TRIM(city)
- remarks=comments
- nameline2=WRAP(nameline,15) ;WRAP( function trim long strings,
- address2=WRAP(address,17) ; leaving remainder for next line
- remarks2=WRAP(remarks,20)
- * text for main line includes customer number, formatted with picture
- TEXT
- .. cust,xxx-x-xx
- #cust #nameline2 #address2 #remarks2
- ENDTEXT
- * test in next line depends on fact that concatenating several fields
- * of blanks and then trimming the result leaves a single blank
- DO WHILE ' '<>TRIM(nameline+address+remarks)
- IF ROW()>55 ;start new page if past line 55
- EJECT
- PERFORM heading
- ENDIF
- nameline2=WRAP(nameline,15)
- address2=WRAP(address,17)
- remarks2=WRAP(remarks,20)
- * text same as main text except customer number omitted
- TEXT
- #nameline2 #address2 #remarks2
- ENDTEXT
- ENDDO
- ? ;skip line after every customer
- SKIP ;get next customer record
- ENDDO
- EJECT
- SET PRINT OFF
- *
- PROCEDURE heading
- ? DATE(full)
- ?? BLANK(52-col()),'Page '+LTRIM(STR(page,5))
- ? CEN(:COMPANY,60)
- ? CEN('Current Customer Listing',60)
- ?
- ? 'Number Name Address Comments'
- ? '======== =============== ================= ===================='
- ?
- page=page+1
- ENDPROCEDURE heading
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 388 SECTION 4
-
-
- *
- PROCEDURE heading
- ?
- ?? DATE(full)
- ?? BLANK(52-col()),'Page '+LTRIM(STR(page,5))
- ? CEN(:COMPANY,60)
- ? CEN('Current Customer Listing',60)
- ?
- ? 'Number Name Address Comments'
- ? '======== =============== ================= ===================='
- ?
- page=page+1
- ENDPROCEDURE heading
-
- Sample output:
-
- Saturday, March 31, 1990 Page 1
- Computer Resellers Corp.
- Current Customer Listing
-
- Number Name Address Comments
- ======== =============== ================= ====================
-
- ALB-A-65 Arthur 876 Main Street Develops LAN-based
- Albredge Suite 987A San software
- Francisco
-
- BRO-W-53 Walter Freeridge Hard-disk
- Brownstone Company 8765 controller and
- Corvis Drive San cache expert
- Jose, CA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 388.1 SECTION 4
-
-
- Note on TEXT Command
-
- The two primary uses of TEXT are list processing (output) and
- screen design (input). Since Info cannot "know" which purpose you
- have in mind when your execute the command, you should "tell" Info how
- the TEXT command should be implemented. Use the SET TEXT OFF command
- for list processing, and SET TEXT ON for screen painting.
-
- SET TEXT controls the way the & and # macros are handled during
- execution of the TEXT command, as follows:
-
- *ON The TEXT display macros created with & and # are
- put into the Get Table; usually required for input
- screens created with TEXT.
- OFF Display macros are not put into the Get Table;
- usually required when using TEXT for printer
- output, as in mail-merge programs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TEXT VPI1 VPI VPIN TEXT
- VP-Info Level 1 Reference Manual Page 389 SECTION 4
-
-
-
- TOTAL
-
- Summarize the information from the selected file (indexed) to a new
- file.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ TOTAL [<scope>] ON <str exp> TO <file> [FIELDS <field list>] ║
- ║ [FOR <cond>] ║
- ║ ║
- ║ <str exp> trigger expression ║
- ║ <file> new file to contain summary information ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Options: ║
- ║ ║
- ║ <scope> selection of records by scope ║
- ║ (default scope: ALL) ║
- ║ FIELDS <field list> the fields to be totalled ║
- ║ FOR <cond> selection of records by <cond> ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- The selected file must be indexed or sorted on <str exp>. The
- records of the selected file can be grouped by the value of <str exp>:
- in each group <str exp> has the same value.
-
- This command creates a new file <file>; for each group of records
- of the selected file, a record is entered in the new file.
-
- This new record is the same as the first record of the group,
- except that the numeric fields in the <field list> are replaced by
- their total for all the records in the group. (Specifying a logical
- or a character field in the <field list> will cause an error.)
-
- Deleted records are ignores irrespective of SET DELETED command.
-
- The following steps describe in detail how this command works:
-
- Step 1. Copies the structure of the selected file to <file>.
-
- Step 2. Appends the first record which satisfies the FOR clause
- (note also scope, deleted records are disregarded) from the selected
- file to the new file.
-
- Step 3. Evaluates <str exp> and saves it in a temporary variable.
-
- Step 4. Takes all subsequent records (if any) for which <str exp>
- does not change. Adds up the fields in the FIELDS clause (if any) and
- stores the sum in the record appended to <file> while <str exp>
- continues to match the value saved in the temporary variable.
-
-
-
-
-
- TOTAL VPI1 VPI VPIN TOTAL
- VP-Info Level 1 Reference Manual Page 390 SECTION 4
-
-
- Step 5. Continue with Step 2, using the first record for which
- <str exp> has a new value.
-
- If no FIELDS clause is in the command line no addition is
- performed, and the resulting file consists only of the first record
- encountered for each different value of <str exp>. A frequent use of
- this feature is to purge the file of records with duplicate keys.
-
- See also the related commands: POST and UPDATE.
-
- Example: Use the ORDER file to find out which STYLE:NO and COLOR
- have been ordered:
-
- 1>USE order
- 1>LIST style:no+color
- 1 A120B1
- 2 C001R3
- 3 M100G5
- 4 A120B1
- 5 M100G5
-
- Of course, this way you get a lot of duplicates. To get each
- STYLE:NO+COLOR only once, make the file STYLESUM (style summary) with
- TOTAL:
-
- 1>INDEX ON style:no+color TO order
- 5 RECORDS IN TOTAL INDEXED
- 1>TOTAL ON style:no+color TO stylesum
- 5 TOTAL(S)
- 1>USE stylesum
- 1>LIST inven:no, style:no, color
- 1 AB0011 A120 B1
- 2 AB0110 C001 R3
- 3 QA1001 M100 G5
-
- This is the desired list.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TOTAL VPI1 VPI VPIN TOTAL
- VP-Info Level 1 Reference Manual Page 391 SECTION 4
-
-
-
- UNLOCK
-
- Unlock the current record.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ UNLOCK VP-Info Network Edition only ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- This command unlocks the current record previously locked. See
- the SET NETWORK command on how to get into the multi-user mode. See
- also LOCK.
-
- Example:
-
- mcust=cust
- FIND &mcust
- LOCK
- REPLACE balance with 0
- UNLOCK
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UNLOCK VPIN UNLOCK
- VP-Info Level 1 Reference Manual Page 392 SECTION 4
-
-
-
- UNLOCK INDEXES
-
- Unlock all indexes on the selected data file.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ UNLOCK INDEXES VP-Info Network Edition only ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- This command unlocks the indexes previously locked on the
- selected data file with the LOCK INDEXES command.
-
- See the SET NETWORK command on how to get into the multi-user
- mode. See also LOCK INDEXES.
-
- Example:
-
- UNLOCK INDEXES
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UNLOCK INDEXES VPIN UNLOCK INDEXES
- VP-Info Level 1 Reference Manual Page 393 SECTION 4
-
-
-
- UPDATE
-
- Update the selected file from an indexed file by replacing selected
- fields.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ UPDATE FROM [<scope>] <file number> ON <str exp> [REPLACE <field1> ║
- ║ WITH <exp1>,...,<fieldn> WITH <expn>] [FOR <cond>] ║
- ║ ║
- ║ <file number> the location of the FROM file ║
- ║ <str exp> the expression that is the key for finding ║
- ║ the record in the FROM file ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Options: ║
- ║ ║
- ║ <scope> selection restricted by scope (default scope: ALL) ║
- ║ REPLACE <field1> WITH <exp1>,...,<fieldn> WITH <expn> ║
- ║ where field1,..,fieldn are fields of the file ║
- ║ in use ║
- ║ <exp1>,...,<expn> are expressions involving fields ║
- ║ of both files ║
- ║ FOR <cond> selection restricted by <cond> ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- The selected file need not be indexed. This procedure takes all
- the appropriate records of the selected file one at a time.
-
- The FROM file has to be indexed by <str exp>; the expression,
- <str exp>, is made up of character fields shared by the two files, and
- by memory variables and constants.
-
- This procedure works as follows:
-
- 1. Takes the first appropriate record (that is, the first
- non-deleted record satisfying the <cond> and within the
- scope).
-
- 2. Evaluates <str exp> in the selected file.
-
- 3. Finds the first matching record in the FROM file.
-
- a. If the FIND is not successful, an "UPDATE ERROR"
- message is sent showing both the record number and
- the value of <str exp> in the selected file. If
- SET PRINT ON, messages are sent to the printer.
-
- b. If the FIND is successful, the procedure replaces
- the fields of the selected file with the
- expressions, <str exp>, made up of fields of both
-
-
-
- UPDATE VPI1 VPI VPIN UPDATE
- VP-Info Level 1 Reference Manual Page 394 SECTION 4
-
-
- files. All fields names are assumed to be in the
- updating file, so make sure #n is attached to any
- field names from the FROM file.
-
- 4. Procedure continues with the next appropriate record as
- long as records remain within the <scope>.
-
- If there is no REPLACE clause, UPDATE simply checks whether all
- the expected records of the FROM file are present.
-
- See also the commands: POST and TOTAL. SET ADD ON has no effect
- on UPDATE.
-
- Example:
-
- The cost of an item is kept updated in the INVENTRY file. To
- update the COST in the ORDER file:
-
- 1>USE#4 inventry INDEX inventry
- 1>USE order
- 1>UPDATE FROM 4 ON inven:no REPLACE cost WITH cost#4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- UPDATE VPI1 VPI VPIN UPDATE
- VP-Info Level 1 Reference Manual Page 395 SECTION 4
-
-
-
- USE
-
- Open data file for use, optionally, with index files.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ USE <file> [INDEX <file list>] [<mode>] [COMPILE] ║
- ║ ║
- ║ <file> the data file to use ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Option: ║
- ║ ║
- ║ INDEX <file list> list of index file names to use ║
- ║ <mode> the file access mode under which DOS is to ║
- ║ open the file ║
- ║ COMPILE open data file at compile time only ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- The command USE opens a data file for use. To open one or more
- index files with the data file, use INDEX and the index file name(s).
- The first index file is the Master Index; this one is in use with the
- FIND, LIST, SKIP, etc. commands. All other index files named will be
- updated by all commands.
-
- The option COMPILE is used to open a data file at compile time
- only. It is used in situations where the data file to be used at run
- time is not available at compile time. One remedy is to put the name
- of the data file in a macro, but then all the field names must be in
- macros. COMPILE offers a better solution if a data file with the same
- structure is available at compile time. For example,
-
- USE inven COMPILE
- USE &file INDEX &file2
-
- will open the data file INVEN at compile time only. At compile time
- the command: USE &file index &file2 is ignored. Now if the structure
- of INVEN is the same as the structure of the data file(s) whose name
- will appear in &file, then the program can use the field name without
- macros. Note that index files are not opened at compile time, so the
- same problem does not effect index files.
-
- Caution: Avoid using data and index file names that start with
- the letters "COMP", since the compiler may mistake the file name
- for the COMPILE keyword and make it impossible to use the file in
- a program.
-
- VP-Info Professional supports four different modes (READ, WRITE,
- LOCK, and SHARE). VP-Info Level 1 support only one mode (READ),
- although the other modes are recognized for compatibility and cause no
- error in any version. The meaning of the four modes is as follows:
-
-
-
- USE VPI1 VPI VPIN USE
- VP-Info Level 1 Reference Manual Page 396 SECTION 4
-
-
-
- LOCK - Open the file for both reading and writing, and maintain
- exclusive use; allow no other users on a network to read or
- write to the file while it is open in LOCK mode. This is
- the default mode for all versions.
-
- WRITE - Open the file for both reading and writing, and allow no
- other users on a network to write to the file, but allow
- other users to open the file in READ mode.
-
- READ - Open the file for reading only, without restricting other
- users on a network from opening it in WRITE or SHARE mode.
- When not on a network, READ mode is useful in ensuring that
- changes made to a file are not saved to disk.
-
- SHARE - Open the file for both reading and writing, without
- restricting the ability of others on a network
-
- See also SET INDEX TO.
-
- Examples:
-
- 1. To open a data file as file 5 while currently you are on file
- 2:
-
- 2>USE#5 customer
- 2>USE#2 invoice INDEX invoice
- 2>USE#1 sales INDEX color,style,ddate
-
- Three data files were opened under the appropriate file numbers.
- Note that the default file number is still 2; the index files are
- separated by commas.
-
- 2. To open a file in READ mode before using EDIT to check data
- without the risk of writing any changes back to disk:
-
- 1>USE employee INDEX emplname READ
- 1>FIND TAYLOR
- 1>EDIT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- USE VPI1 VPI VPIN USE
- VP-Info Level 1 Reference Manual Page 397 SECTION 4
-
-
-
- VARIABLES
-
-
- Enters a list of memory variable names into the variables table.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ VARIABLES <variables list> ║
- ║ ║
- ║ <variables list> list of memory-variable names ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- VP-Info Level 1 allows up to 128 variables to be defined at a
- time. Their names are listed in a variables table, which is displayed
- with the LIST MEMORY command.
-
- When a program is compiled, each time VP-Info Level 1 encounters
- a name not already in the table, it is added. As a programmer, you
- can control the order of variables in the table by naming them in the
- variables list with the VARIABLES command. This is not only good
- practice in general, but it can help in debugging, and makes it
- possible to be sure every variable you use is being defined, and that
- no others are being inadvertently created.
-
- The variables command should never be used in a subroutine, and
- can be used only once in the main routine. It should come after any
- GLOBAL command, but before any other variable is defined.
-
- Example in a program:
-
- VARIABLES start,finish,mcust,mserial
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- VARIABLES VPI1 VPI VPIN VARIABLES
- VP-Info Level 1 Reference Manual Page 398 SECTION 4
-
-
-
- WAIT
-
- Accept one character from the keyboard.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ WAIT [TO <memvar>] ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Option: ║
- ║ ║
- ║ TO <memvar> store the character into this variable ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- When VP-Info Level 1 encounters the WAIT command, the program
- execution stops, the message: WAITING is displayed; VP-Info Level 1
- waits for a character to be entered at the keyboard. When a key is
- hit, program execution continues.
-
- If the option: TO <memvar> is used, the character is stored in
- the string memory variable <memvar>; this cannot be a matrix variable.
- If the variable <memvar> does not exist, it will be created.
-
- This command is useful to suspend the program execution so that
- the user can read a message on the screen, and maybe make a choice.
-
- See also the INKEY( function.
-
- Examples:
-
- 1. A program segment:
-
- @ 20,0 SAY 'Turn the printer on. Hit any key when ready.'
- WAIT
-
- After the message is displayed, VP-Info Level 1 waits for the
- user to hit a key indicating that the printer is now on.
-
- 2. A typical, simple menu using WAIT:
-
- DO WHILE T
- ERASE
- TEXT
- MENU
-
- 1. General Ledger
- 2. Invoicing
- 3. Receivables
-
- Type in your choice:
- ENDTEXT
-
-
-
- WAIT VPI1 VPI VPIN WAIT
- VP-Info Level 1 Reference Manual Page 399 SECTION 4
-
-
- WAIT TO ans
- IF ans>'0' .OR. ans<'4'
- BREAK
- ENDIF
- ENDDO
- DO CASE
- CASE ans='1'
- DO ...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WAIT VPI1 VPI VPIN WAIT
- VP-Info Level 1 Reference Manual Page 400 SECTION 4
-
-
-
- WINDOW
-
- Defines the active window, that part of the screen to which relative
- output can be sent.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ WINDOW ║
- ║ WINDOW <row1>,<row2> [COLOR <windowcolor> [<bordercolor>]] ║
- ║ WINDOW <row1>,<col1>,<row2>,<col2> [COLOR <windowcolor> ║
- ║ [,<bordercolor>]] [BLANK/DOUBLE] ║
- ║ ║
- ║ <row1>,<row2> the top and bottom of the window to be created; ║
- ║ with no column numbers given, the window is ║
- ║ full width with no border permitted ║
- ║ <row1>,<col1> the coordinates of the top-left corner of the window║
- ║ <row2>,<col2> the coordinates of the bottom right corner of the ║
- ║ window ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Options: ║
- ║ ║
- ║ COLOR <windowcolor> the color of the area inside the window ║
- ║ <bordercolor> the color of the window border ║
- ║ BLANK the window has no border ║
- ║ DOUBLE the window double-line borders (default ║
- ║ single-line borders) ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- Unlike the BOX command, WINDOW erases the area within the
- coordinates given, and if corners are specified, displays an optional
- border one space outside the border coordinates.
-
- Although the fixed-position display commands like @ SAY can write
- either inside or outside the window, all the relative display commands
- like ?, ??, LIST, DISPLAY, TEXT, etc., are restricted to the active
- window.
-
- The window can be deactivated (i.e., reset to the entire screen
- size) by the WINDOW command alone.
-
- The rows are numbered 0 to 24. Since a row is always allowed
- above and below the window coordinates, the actual range of row
- numbers for the WINDOW command is 1 through 23.
-
- The columns are numbered 0 to 79. Since a column is always
- allowed to the left and right of the window coordinates, the actual
- range of column numbers for the WINDOW command is 1 through 78.
-
- Note that commas are required between coordinates, but are not
- permitted before the keywords COLOR, BLANK, and DOUBLE.
-
-
-
- WINDOW VPI1 VPI VPIN WINDOW
- VP-Info Level 1 Reference Manual Page 401 SECTION 4
-
-
-
- In programs, WINDOW is often used to position TEXT and may be
- useful in setting up BROWSE, EDIT, WRITE and other input/output
- displays.
-
- Examples:
-
- 1. Use WRITE to edit a file in the bottom half of the screen:
-
- CLS
- CURSOR 5,20
- ACCEPT "Enter name of file to edit " to fil_nam
- WINDOW 8,5,22,74 color 7,112 double
- WRITE &fil_nam OFF
- WINDOW
-
- 2. Use BROWSE with a TEXT file in a window:
-
- USE customer
- WINDOW 2,22 color 112
- BROWSE TEXT customer
- WINDOW
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WINDOW VPI1 VPI VPIN WINDOW
- VP-Info Level 1 Reference Manual Page 402 SECTION 4
-
-
-
- WRITE
-
- Activate the program editor.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ WRITE [<file>/.<volume>/M.<file>] [OFF] ║
- ╟────────────────────────────────────────────────────────────────────╢
- ║ Options: ║
- ║ ║
- ║ <file> name of file to be created or edited ║
- ║ <volume> number of a volume in the current library; a numeric ║
- ║ expression ║
- ║ <memo> name of a memo field in the current data file ║
- ║ OFF omit header and opportunity to rename file or volume ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- A simple program editor is provided to make it possible to write
- and edit programs in VP-Info Level 1. If <file>, <volume> or <memo>
- is not specified, the last file used is understood to be the file to
- edit. If no extension is specified, PRG is assumed. This editor is
- very useful for debugging programs and reports.
-
- Note that library volumes are addressed by placing a period in
- front of the volume number, which can be either a numeric constant or
- a numeric expression. Memos are addressed by preceding the field name
- with "M." Do not confuse this usage of periods with a decimal point.
-
- OFF causes WRITE to omit the top three lines of the screen (file
- name and ruler, etc.) and places the cursor at the beginning of the
- file in the top left corner of the current window (the entire screen
- if no window is active), and to save the file immediately upon sensing
- the <End> key without giving an opportunity to change the file name.
- WRITE OFF is used primarily inside programs under program control, and
- with an active window.
-
- The editing keys are the same as in full-screen editing. WRITE
- uses an 80 character "window" for its 254 character lines.
-
- The maximum size of a text file is about 20,000 characters with
- no data files open. Using data and index files reduces space
- available for WRITE, as does running WRITE inside a program; consider
- running WRITE from a subroutine instead of the main routine if maximum
- file size is required.
-
- Editing keys:
-
- <Left> or Ctrl-S moves the cursor back one character
- <Right> or Ctrl-D moves the cursor forward one character
- <Up> or Ctrl-E moves the cursor to the previous line
- <Dn> or Ctrl-X moves the cursor to the next line
-
-
-
- WRITE VPI1 VPI VPIN WRITE
- VP-Info Level 1 Reference Manual Page 403 SECTION 4
-
-
-
- Ctrl-<Left> moves to the beginning of the line
- Ctrl-<Right> moves to the end of the line
-
- Ctrl-<Home> moves to the beginning of the document
- Ctrl-<End> moves to the end of the document
-
- Ctrl-N inserts a new line
- Ctrl-T deletes the line
-
- <PgUp> or Ctrl-R displays previous page
- <PgDn> or Ctrl-C displays next page
-
- <BACKSPACE> deletes the character to the left of the
- cursor
- <Del> or Ctrl-G deletes the character on the cursor
- Ctrl-Y deletes the rest of the line
-
- <Ins> or Ctrl-V puts you in insert mode: what you type gets
- inserted (normally, you are in overtype
- mode: what you type overtypes the existing
- text); pressing <Ins> or Ctrl-V again, puts
- you back into overtype mode
-
- <End> or Ctrl-W quits and updates text
- Ctrl-Q quits and does not update text
-
- Ctrl-P prints entire document on printer
- Alt-F formats program
- Alt-H displays a help screen
-
- To break a line into two, press <Ins> to get into insert mode,
- and press <ENTER>. To merge two lines, delete the end of line
- character. When you leave the line (with a cursor key or <End>), the
- two lines merge.
-
- Alt-F formats program files; it indents the lines according to
- the program structures and capitalizes the first command verb on every
- line.
-
- When using WRITE, Alt-H displays the following information (press
- any key, and the help screen disappears):
-
- You may use WRITE to transfer any text (up to the available
- memory limit) between any two forms -- DOS file to library, or DOS file
- to memo field, for example -- by importing it into WRITE and changing
- its name to another valid form before saving the text.
-
-
-
-
-
-
- WRITE VPI1 VPI VPIN WRITE
- VP-Info Level 1 Reference Manual Page 404 SECTION 4
-
-
-
- ──────────────────────────────────────────────────────────────────────────────
- GENERAL.PRG VP-Info WRITE (Press Alt-H for Help)
-
- ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
-
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ VP-Info WRITER HELP │
- │ │
- │Delete and Insert Block Commands Miscellaneous │
- │═════════════════ ═══════════════ ═════════════ │
- │Delete character..... <Del> Mark block.... Alt-B QUIT: │
- │Delete to end of line ^Y Move block.... Alt-M with save.... <End> │
- │ Copy block.... Alt-C without save. ^Q │
- │Delete line.......... ^T Delete block.. Alt-D │
- │Insert line.......... ^N Remove marks.. Alt-K PRINT TEXT... ^P │
- │ │
- │Insert-mode toggle... <Ins> Tab.......... TAB Key FORMAT PROGRAM Alt-F│
- │ │
- │ ┌─────────────────────────── FAST CURSOR MOVEMENT ───────────────────────┐ │
- │ │ End of line... ^<Rght> Page up....... <PgUp> Top of text... ^<Home> │ │
- │ │ Start of line. ^<Lft> Page down..... <PgDn> Bottom of text ^<End> │ │
- │ └────────────────────────────────────────────────────────────────────────┘ │
- │ │
- │NOTES: 1. ^ is Ctrl 2. Keys in pointed brackets are on the Numeric Keypad│
- └────────────────────────────────────────────────────────────────────────────┘
- Press any key to continue ...
- ──────────────────────────────────────────────────────────────────────────────
-
- Examples:
-
- 1>WRITE test ;write TEST.PRG
- 1>WRITE test.txt ;write TEST.TXT
- 1>WRITE test.dat OFF ;write TEST.DAT with suppression of header
- 1>WRITE .65 ;write volume 65 in the current library
- 1>WRITE .num ;write volume number contained in NUM in the
- current library
- 1>WRITE .num OFF ;write volume number contained in NUM in the
- current library with suppression of header
- 1>WRITE .:avail ;write the next available volume (Caution: be
- sure to capture this value before using
- this construct or you'll never be able to
- find your text again.)
- 1>WRITE m.credit ;write a memo referenced by the memo field
- CREDIT in the current data file
- 1>WRITE m.credit#3 ;write a memo referenced by the memo field
- CREDIT in data file currently open in work
- area 3
-
-
-
-
-
- WRITE VPI1 VPI VPIN WRITE
- VP-Info Level 1 Reference Manual Page 405 SECTION 4
-
-
-
- ZAP
-
- Erase all records in the selected file.
-
- ╔════════════════════════════════════════════════════════════════════╗
- ║ ZAP ║
- ╚════════════════════════════════════════════════════════════════════╝
-
- This command erases all the records. This is not a DELETE. The
- records cannot be recalled! Use this command with care!
-
- If the selected file is indexed, it is automatically reindexed
- after ZAP.
-
- ZAP releases the disk space previously used by the records of the
- data file.
-
- On a network with SET NETWORK ON in VP-Info Professional Network
- Edition, attempting to ZAP while another user is accessing the file
- will cause a LOCK error. Always LOCK the file before ZAP.
-
- Example:
-
- 1>USE employee
- 1>COPY TO empl1
- 1>USE empl1
- 1>ZAP
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ZAP VPI1 VPI VPIN ZAP