table.PERSIST Function

Syntax

V Persist()

Description

Flags opened table to not be closed automatically on termination of script.

Discussion

Normally, when a script ends, Alpha Anywhere will automatically close any open tables. The <TBL>.PERSIST() method can keep the table open after the script ends, so that a subsequent script can access the table without the overhead of having to open it again.

Example 

This code is attached to a button on a form. It opens the table and keeps the table open when the script ends.

dim shared tbl as P
tbl = table.open("customer")
' ... do something
tbl.persist()
' ... script ends

This code is attached to another button on a form. It works because the previous script used the .PERSIST() method to keep the table open.

' ... new script starts
dim shared tbl as P
' ... it is not necessary to reopen the table
tbl.enter_begin()
tbl.name = "Sam"
tbl.enter_end(.T.)

See Also