Difference between revisions of "RESTORE DATASESSION"

From Recital Documentation Wiki
Jump to: navigation, search
(Description)
(Example)
 
(3 intermediate revisions by one user not shown)
Line 13: Line 13:
 
The RESTORE DATASESSION command is used to restore the status of all open tables.  The RESTORE DATASESSION command restores the following context pertaining to the saved session (See [[SAVE DATASESSION]]):
 
The RESTORE DATASESSION command is used to restore the status of all open tables.  The RESTORE DATASESSION command restores the following context pertaining to the saved session (See [[SAVE DATASESSION]]):
  
* Currently selected workarea
+
* Currently selected cursor/workarea
* Workarea number  
+
* Cursor/Workarea number  
* database name
+
* Database name
* full path of table  
+
* Full path of table  
* all index files
+
* All index files
 
* Current record number
 
* Current record number
 
* Current index order
 
* Current index order
Line 25: Line 25:
 
* found() status
 
* found() status
  
The [[SAVE DATASESSION]] command may be used to save the above information. SAVE and RESTORE DATASESSION can be used with Recital Wen session variables to maintain context between different .rsp web page requests.
+
The [[SAVE DATASESSION]] command may be used to save the above information. SAVE and RESTORE DATASESSION can be used with Recital Web session variables ( _SESSION[ ] ) to maintain context between different .rsp web page requests.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
procedure check_value
+
save datasession
  save datasession
+
close all
  close all
+
 
  // open up some new tables using a new datasession
+
// open up some new tables in a new datasession
  restore datasession
+
 
return
+
restore datasession
 
</code>
 
</code>
  
 +
<code lang="recital">
 +
save datasession to statevar
 +
_session[ "statevar" ] = statevar
 +
 +
// you can then restore the session on the next web page request like this
 +
 +
statevar = _session[ "statevar" ]
 +
restore datasession from statevar
 +
</code>
  
 
==Products==
 
==Products==

Latest revision as of 07:43, 3 June 2011

Purpose

Save the status of the current data session


Syntax

RESTORE DATASESSION [ FROM <memvar>]

See Also

@...GET, CHANGE, EDIT, ON KEY, READ, REPLACE(), RESTORE RECORDVIEW, SAVE DATASESSION, SET CLIPPER, SET KEY, SET PCKEYS, SKIP


Description

The RESTORE DATASESSION command is used to restore the status of all open tables. The RESTORE DATASESSION command restores the following context pertaining to the saved session (See SAVE DATASESSION):

  • Currently selected cursor/workarea
  • Cursor/Workarea number
  • Database name
  • Full path of table
  • All index files
  • Current record number
  • Current index order
  • Lock status
  • eof() status
  • bof() status
  • found() status

The SAVE DATASESSION command may be used to save the above information. SAVE and RESTORE DATASESSION can be used with Recital Web session variables ( _SESSION[ ] ) to maintain context between different .rsp web page requests.

Example

save datasession
close all
 
// open up some new tables in a new datasession
 
restore datasession
save datasession to statevar
_session[ "statevar" ] = statevar
 
// you can then restore the session on the next web page request like this
 
statevar = _session[ "statevar" ]
restore datasession from statevar

Products

Recital, Recital Web