NetTalk Central

Author Topic: EQUATES for SessionValues  (Read 9157 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
EQUATES for SessionValues
« on: November 03, 2011, 09:15:43 AM »
Hope doesn't show up twice.

I use Session Values extensively to pass values between procedures or between threads on Form procedures.  To reduce the time spent tracking down bugs associated with Session Value typos, I created an Extension template that creates an EQUATE for each specified Session Value, e.g.,
MySessionValue      EQUATE('MySessionValue')

Using EQUATES instead of String values in NetTalk functions that use developer defined Session Values, e.g., p_web,GSV(MySessionValue),  means the compiler catches any typos.   Also, EQUATES are available to code completion in C7/C8 for greater speed and accuracy.

Add the template to each procedure that uses the specified Session Value.   The template also lets you optionally include the Session Value in a housekeeping routine that deletes the Session Value when you are finished with it, usually the Post action section of a parent form.

You can add the template to existing procedures that already have Session Values without having to track down each use of the Session Value. Just enter the same text for the EQUATE as used in the existing Session Value.

The template is attached.  If someone with more template skill wants to clean it up or extend it, feel free.



[attachment deleted by admin]