Global Variables

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jtaljaard
Posts: 37
Joined: Thu Sep 21, 2023 9:29 pm

Global Variables

Post by jtaljaard »

Is there a method we can use to pass through variables to other components (different forms/reusable parts)?

Currently, we use:
Use Builtin(SET_SESSION_VALUE) With_Args('UDEF=' #COMPCODE.AsString)

But should we later need the value in a different form and we use the get_session_value the value will be reset to 0. What is a method to create a variable that we can constantly reference should we need specific data from it?

The other limitation is that we cant pass multiple variables with set_session_value
cesarrafael
Posts: 32
Joined: Tue Dec 01, 2015 3:44 am

Re: Global Variables

Post by cesarrafael »

Hi jtaljaard,

It depends of what you're trying to achieve and the type of application....You can use Data areas (dtaara) objects to store information, you can create "user space" objects, you can save lists, you can create reusable parts that can use the "scope application" and will hold values in memory for as long as the session is active...
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: Global Variables

Post by René Houba »

Hi Jared,

In the June 2020 Newsletter I explain the SCOPE(*APPLICATION):
SCOPE.PNG
SCOPE.PNG (103.43 KiB) Viewed 63232 times
Newsletter download:
https://lansa.com/support/newsletter20.html

I'm working on a new Newsletter at the moment, where I show an example with SCOPE(*APPLICATIONS) and VL Web components.

Kind regards,
René
jtaljaard
Posts: 37
Joined: Thu Sep 21, 2023 9:29 pm

Re: Global Variables

Post by jtaljaard »

Awesome, thank you so much Rene.
Post Reply