- Forum
- T24 Technical Discussions
- jBASE / TAFC
- TAFJ / How can I create Global Variables without declaring in .Component
TAFJ / How can I create Global Variables without declaring in .Component
- McLanJohn
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
2 years 3 months ago #23826
by McLanJohn
TAFJ / How can I create Global Variables without declaring in .Component was created 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,
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
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
Less
More
- Posts: 267
- Thank you received: 21
2 years 3 months ago #23827
by silvergem
Replied by silvergem on topic TAFJ / How can I create Global Variables without declaring in .Component
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
Less
More
- Posts: 11
- Thank you received: 0
2 years 2 months ago #23830
by McLanJohn
Replied by McLanJohn on topic TAFJ / How can I create Global Variables without declaring in .Component
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.
- 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
- Offline
- Elite Member
- TAFC|R12/R13, TAFJ|R20
Less
More
- Posts: 267
- Thank you received: 21
2 years 2 months ago #23831
by silvergem
Replied by silvergem on topic TAFJ / How can I create Global Variables without declaring in .Component
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
Less
More
- Posts: 11
- Thank you received: 0
2 years 2 months ago #23835
by McLanJohn
Replied by McLanJohn on topic TAFJ / How can I create Global Variables without declaring in .Component
Oh, well I did not know how to "save them" in it. Thanks
Please Log in or Create an account to join the conversation.
- Forum
- T24 Technical Discussions
- jBASE / TAFC
- TAFJ / How can I create Global Variables without declaring in .Component
Time to create page: 0.085 seconds