Results 1 to 2 of 2

Thread: Coding Tip: Using data sessions

  1. #1
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,240

    Coding Tip: Using data sessions

    You can save and restore data sessions like this.

    Code:
    SAVE DATASESSION TO m_session
    // do something opening up new tables
    RESTORE DATASESSION FROM m_session

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,240
    When using .rsp web pages you can maintain the exact state (database, tables, and record etc) of each cursor between pages like this.

    Code:
    // On entry to the .rsp page.
    
    IF type( '_session["state"]' ) != "U"
         m_state = _session["state"]
         RESTORE DATASESSION FROM m_state
    ELSE
         // open up your tables for the first time
    ENDIF
    
    // On exit of the .rsp page.
    SAVE DATASESSION TO m_state
    _SESSION["state"] = m_state
    Notice how you can store any variables into the _session[] dynamic array.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us