[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+------+###################################################################
#+-| READ |------------------------------------------------+##################
#| +------+ The READ command activates pending GETs. READ |##################
#| commands may be nested using the save_gets() |##################
#| function and restore_gets procedure. |##################
#+---------------------------------------------------------+##################
##############################################################################
##############################################################################
#+--| Syntax |---------+######################################################
#| READ [SAVE] |######################################################
#+---------------------+######################################################
##############################################################################
##############################################################################
#######+---| Description |--------------------------------------------+#######
#######| Unless the SAVE command is issued, GETs will be cleared from |#######
#######| memory when the READ terminates. |#######
#######+--------------------------------------------------------------+#######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Insert a GET, READ the GET and have the GET |#########
#########| * cleared from memory. |#########
#########| |#########
#########| @ 10,10 GET data->name |#########
#########| READ |#########
#########| READ && Causes an error because the |#########
#########| && GET has been cleared from |#########
#########| && memory. |#########
#########| |#########
#########| @ 10,10 GET data->name |#########
#########| READ SAVE |#########
#########| READ && Rereads the previous GET. |#########
#########| && After termination of the |#########
#########| && READ, the GET will be |#########
#########| && removed from memory. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Instead of a format file, FORCE works with |#########
#########| * a FORMAT BLOCK. A FORMAT BLOCK can be |#########
#########| * specified for a READ using SET |#########
#########| * FORMAT TO <Format-ident>. |#########
#########| |#########
#########| FORMAT my_format |#########
#########| @1,10 SAY "line one " GET d->field_one |#########
#########| @2,10 SAY "line two " GET d->field_two |#########
#########| @3,10 SAY "line three " GET d->field_three |#########
#########| ENDPRO |#########
#########| |#########
#########| {...} |#########
#########| |#########
#########| SET FORMAT TO my_format |#########
#########| READ && Uses the code in |#########
#########| && FORMAT BLOCK my_format |#########
#########| && for the READ. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * Have a filter routine issue a nested get. |#########
#########| |#########
#########| FUNCTION UINT nested_gets |#########
#########| IF lastkey() = &K_F10 && if F10 is pressed then |#########
#########| save_gets() && save our current GETs |#########
#########| @ 7,50 SAY "Acct code: " GET a->ac; |#########
#########| READ && get account code |#########
#########| restore_gets() && restore original GET |#########
#########| !a SEEK ac && find account in |#########
#########| && another database |#########
#########| DO display_ac && display the account |#########
#########| && code |#########
#########| RETURN 0 && tell READ to ignore |#########
#########| && last key pressed |#########
#########| ENDIF |#########
#########| RETURN lastkey() |#########
#########| ENDPRO |#########
#########| |#########
#########| {...} |#########
#########| @ rr,cc GET avar FILTER nested_gets() |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
ACCEPT
FORMAT
GET
SET FORMAT TO
restore_gets
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson