Difference between revisions of "POP DATASESSION"

From Lianjapedia
Jump to: navigation, search
(Created page with "''Coming Soon''")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Coming Soon''
+
==Purpose==
 +
Restore the last 'pushed' data session
 +
 
 +
==Syntax==
 +
POP DATASESSION
 +
 
 +
==See Also==
 +
[[DATASESSIONLEVEL()]], [[PUSH DATASESSION]], [[RESTORE DATASESSION]], [[RESTORE RECORDVIEW]], [[SAVE DATASESSION]], [[SAVE RECORDVIEW]]
 +
 
 +
==Description==
 +
The POP DATASESSION command is used to restore the last data session saved with [[PUSH DATASESSION]].  Data sessions can be pushed and popped up to 256 levels deep and operate on a last in, first out basis.
 +
 
 +
The [[SAVE DATASESSION]] and [[RESTORE DATASESSION]] commands can also be used to save and restore the current data session, optionally saving and restoring from a memory variable.
 +
 
 +
==Example==
 +
<code lang="recital">
 +
? datasessionlevel()  // returns 0
 +
// save the current data session
 +
push datasession
 +
? datasessionlevel()  // returns 1
 +
// Carry out other operations with different data
 +
// then save this second data session
 +
push datasession
 +
? datasessionlevel()  // returns 2
 +
// Carry out other operations with different data
 +
// then restore the second data session
 +
pop datasession
 +
? datasessionlevel()  // returns 1
 +
// Carry out other operations with different data
 +
// then restore the original data session
 +
pop datasession
 +
? datasessionlevel()  // returns 0
 +
</code>
 +
 
 +
[[Category:Documentation]]
 +
[[Category:Commands]]
 +
[[Category:Databases]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Command Extensions]]
 +
[[Category:Lianja v3.0]]

Latest revision as of 06:01, 19 March 2018

Purpose

Restore the last 'pushed' data session

Syntax

POP DATASESSION

See Also

DATASESSIONLEVEL(), PUSH DATASESSION, RESTORE DATASESSION, RESTORE RECORDVIEW, SAVE DATASESSION, SAVE RECORDVIEW

Description

The POP DATASESSION command is used to restore the last data session saved with PUSH DATASESSION. Data sessions can be pushed and popped up to 256 levels deep and operate on a last in, first out basis.

The SAVE DATASESSION and RESTORE DATASESSION commands can also be used to save and restore the current data session, optionally saving and restoring from a memory variable.

Example

? datasessionlevel()  // returns 0
// save the current data session
push datasession
? datasessionlevel()  // returns 1
// Carry out other operations with different data
// then save this second data session
push datasession
? datasessionlevel()  // returns 2
// Carry out other operations with different data
// then restore the second data session
pop datasession
? datasessionlevel()  // returns 1
// Carry out other operations with different data
// then restore the original data session
pop datasession
? datasessionlevel()  // returns 0