Difference between revisions of "PUSH DATASESSION"

From Lianjapedia
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[POP DATASESSION]], [[RESTORE DATASESSION]], [[RESTORE RECORDVIEW]], [[SAVE DATASESSION]], [[SAVE RECORDVIEW]], [[SKIP]]
+
[[DATASESSIONLEVEL()]], [[POP DATASESSION]], [[RESTORE DATASESSION]], [[RESTORE RECORDVIEW]], [[SAVE DATASESSION]], [[SAVE RECORDVIEW]]
  
 
==Description==
 
==Description==
The PUSH DATASESSION command is used to save the current data session.  It can then be restored using the [[POP DATASESSION]] command.  Data sessions can be pushed and popped up to 256 levels deep they operate on a last in, first out basis.  All tables are closed by the PUSH DATASESSION command.
+
The PUSH DATASESSION command is used to save the current data session.  It can then be restored using the [[POP DATASESSION]] command.  Data sessions can be pushed and popped up to 256 levels deep and operate on a last in, first out basis.  All tables are closed by the PUSH DATASESSION command.
  
 
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.  
 
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.  
Line 15: Line 15:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 +
? datasessionlevel()  // returns 0
 
// save the current data session
 
// save the current data session
 
push datasession
 
push datasession
 +
? datasessionlevel()  // returns 1
 
// Carry out other operations with different data
 
// Carry out other operations with different data
 
// then save this second data session
 
// then save this second data session
 
push datasession
 
push datasession
 +
? datasessionlevel()  // returns 2
 
// Carry out other operations with different data
 
// Carry out other operations with different data
 
// then restore the second data session
 
// then restore the second data session
 
pop datasession
 
pop datasession
 +
? datasessionlevel()  // returns 1
 
// Carry out other operations with different data
 
// Carry out other operations with different data
 
// then restore the original data session
 
// then restore the original data session
 
pop datasession
 
pop datasession
 +
? datasessionlevel()  // returns 0
 
</code>
 
</code>
  
Line 33: Line 38:
 
[[Category:Lianja VFP Extensions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:VFP Command Extensions]]
 
[[Category:VFP Command Extensions]]
[[Category:Lianja v2.1]]
+
[[Category:Lianja v3.0]]

Latest revision as of 06:03, 19 March 2018

Purpose

Save the current data session

Syntax

PUSH DATASESSION

See Also

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

Description

The PUSH DATASESSION command is used to save the current data session. It can then be restored using the POP DATASESSION command. Data sessions can be pushed and popped up to 256 levels deep and operate on a last in, first out basis. All tables are closed by the PUSH DATASESSION command.

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