View previous topic :: View next topic
|
Author |
Message |
Renato Zangerolami
New User
Joined: 06 Dec 2019 Posts: 28 Location: Brazil
|
|
|
|
I created a variable in 7.3, p (profile). What are the ways that I can use this variable? I tried to call it with ISPF NAME VARIABLE but it didn't work. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Assuming REXX: ADDRESS ISPEXEC "VGET varname PROFILE". For details see the 'ISPF Services Guide' manual. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
There are two services:
Code: |
Address ISPEXEC
"VPUT myvar PROFILE"
"VGET myvar PROFILE"
|
There is also a VERASE service, but it is not commonly used... most developers just leave the variables lingering forever.
My suggestion is to use VGET first and if you get RC=8 (for variable not found) then you set a default value. If the user changes from the default value, then use VPUT to save the user's setting. |
|
Back to top |
|
|
Renato Zangerolami
New User
Joined: 06 Dec 2019 Posts: 28 Location: Brazil
|
|
|
|
Thanks for the answers.
can the profile option be used only for my user? Can I create a variable where all users can use it? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Not like that. Create a REXX which everyone can execute. There are ways, one I kinda like is:
Rexx with variables, sample name SETVAR:
Return "v1='Kilroy';v2='was';v3='here'"
Rexx using the variables:
Interpret SetVar() |
|
Back to top |
|
|
|