TAFJ / How can I create Global Variables without declaring in .Component

  • McLanJohn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #23826 by McLanJohn
Hello all, how are you

As the title implies, is there a way I can declare global variables without having to declare them in the package's .COMMON and .COMPONENT files? I want to create a generic routine whose flow includes the need to set global variables based on a user inputted argument. 

Thank you,
Best Regards, 

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
2 years 3 months ago #23827 by silvergem
You can put it on F.LOCKING table or EB.USER.CONTEXT (per user) or create your own table. variables on .COMMON and .COMPONENT stays on memory, normally they retrieve this based on table or file as parameter

Please Log in or Create an account to join the conversation.

  • McLanJohn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #23830 by McLanJohn
Found the answer thanks. For those wondering, you can use:

- EB.Browser.SystemSetvariable(var,setVar)
- EB.Browser.SystemGetvariable(var)

You need to use it in this form:

Y.VAR = Any string value you want
X.VAR = 'CURRENT.' : ANY.VALUE .
> using 'CURRENT.' is mandatory. ANY.VALUE can be another variable. If it is a string, put it all under ' ' without the need to use : in order to concat

EB.Browser.SystemSetvariable(X.VAR, Y.VAR)

Z.VAR = EB.Browser.SystemGetvariable(X.VAR)

If you use get before set it, it will return the string 'CURRENT.' : ANY.VALUE. So make sure to put certain validation before using the get function.

Please Log in or Create an account to join the conversation.

  • silvergem
  • silvergem's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • TAFC|R12/R13, TAFJ|R20
More
2 years 3 months ago #23831 by silvergem
which saved data in EB.USER.CONTEXT.TABLE :)

Please Log in or Create an account to join the conversation.

  • McLanJohn
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #23835 by McLanJohn
Oh, well I did not know how to "save them" in it. Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.103 seconds