Quote from PaulJonestindall on October 3, 2019, 4:25 pmCan a compound variable NOT be displayed in a text box?
Example:
I place this in a button actionSetVar "[T]" "1" SetVar "[temp[T]]" "temp1"And I place this code in a text box
[temp[T]] [temp1]Click the button. Only the [temp1] variable displays in the text box and the compound variable does not.
Can a compound variable NOT be displayed in a text box?
Example:
I place this in a button action
SetVar "[T]" "1" SetVar "[temp[T]]" "temp1"
And I place this code in a text box
[temp[T]] [temp1]
Click the button. Only the [temp1] variable displays in the text box and the compound variable does not.

Quote from Vadim on October 3, 2019, 9:54 pmHello!
Yes it's true.
You can put the value of a compound variable in another. To display in a text object.SetVar "[T]" "1"
SetVar "[temp[T]]" "abcde"
SetVar "[temp]" "[temp[T]]"
And display like this:
[temp1]
[temp]
Hello!
Yes it's true.
You can put the value of a compound variable in another. To display in a text object.
SetVar "[T]" "1"
SetVar "[temp[T]]" "abcde"
SetVar "[temp]" "[temp[T]]"
And display like this:
[temp1]
[temp]
Quote from PaulJonestindall on October 3, 2019, 11:32 pmOk. So, the compound variable will NOT display in a text object.
My goal here was to create a "virtual" variable of sorts.
Thanks for the confirmation. The idea was to be able to use the "virtual" variable with this keypad I made so that I could use it multiple times programmatically, with a minimum of coding.
Here is my keypad PUB with only the "1" button containing the compound variable. You can see it working in the debug but it doesn't display in the text object. It could be useful for multiple keypads?
Ok. So, the compound variable will NOT display in a text object.
My goal here was to create a "virtual" variable of sorts.
Thanks for the confirmation. The idea was to be able to use the "virtual" variable with this keypad I made so that I could use it multiple times programmatically, with a minimum of coding.
Here is my keypad PUB with only the "1" button containing the compound variable. You can see it working in the debug but it doesn't display in the text object. It could be useful for multiple keypads?
Uploaded files:Quote from Gaev on October 4, 2019, 12:50 am@pauljonestindall
Here is my keypad PUB with only the "1" button containing the compound variable.
Sorry, I do not see a compound variable in the code for the "1" button ...
StrLen "[tempnumber]" "[tempnumberlenx]" If "[tempnumberlenx]" "=" "[MaxNumLen]" GotoLine "end" EndIf SetVar "[tempnumber]" "[tempnumber]1" :endso that I could use it multiple times programmatically, with a minimum of coding.
Try this one line of code for each of the number buttons (and the decimal point button) ...
GoSub "commonCode"... and this is the subroutine code ...
:commonCode StrLen "[tempnumber]" "[tempnumberlenx]" If "[tempnumberlenx]" "<" "[MaxNumLen]" GetObjectInfo "[Self]" "Caption" "[thisButtonCaption]" SetVar "[tempnumber]" "[tempnumber][thisButtonCaption]" EndIf ReturnHope that was what you were looking for.
Added later - if you want to have buttons with captions that are more than one character, the subroutine would be slightly more complex.
Here is my keypad PUB with only the "1" button containing the compound variable.
Sorry, I do not see a compound variable in the code for the "1" button ...
StrLen "[tempnumber]" "[tempnumberlenx]" If "[tempnumberlenx]" "=" "[MaxNumLen]" GotoLine "end" EndIf SetVar "[tempnumber]" "[tempnumber]1" :end
so that I could use it multiple times programmatically, with a minimum of coding.
Try this one line of code for each of the number buttons (and the decimal point button) ...
GoSub "commonCode"
... and this is the subroutine code ...
:commonCode StrLen "[tempnumber]" "[tempnumberlenx]" If "[tempnumberlenx]" "<" "[MaxNumLen]" GetObjectInfo "[Self]" "Caption" "[thisButtonCaption]" SetVar "[tempnumber]" "[tempnumber][thisButtonCaption]" EndIf Return
Hope that was what you were looking for.
Added later - if you want to have buttons with captions that are more than one character, the subroutine would be slightly more complex.
Quote from PaulJonestindall on October 4, 2019, 1:31 pmSorry about that. I must not have saved it. Here it is again.
Sorry about that. I must not have saved it. Here it is again.
Uploaded files:Quote from Gaev on October 4, 2019, 3:55 pm@pauljonestindall
Here it is again.
I am not sure what exactly you are trying to do here ... tell me if my guess below is correct ...
When you have multiple "keypads" ...
a) you choose one particular "keypad" by typing in the number (of this keypad) in TextEntry2, which is then saved in variable [N]
b) you want to store/save [tempnumber] values for each "keypad" in variables [tempnumber[N]], and display them in Text7; which does not refresh when the compound variable changes.
Assuming that each of your "keypads" will be defined inside a separate container (like TempNumber), I suggest you ...
a) you assign the simple variable [tempnumber] to Text7 (and remove Number altogether) ... in other words, use a single object to show current input for all keypads.
b) in order to store/save the values of the "current keypad", you can swap them in/out of Text7 by altering [tempnumber] via event code associated with the change of "keypad" (i.e. TextEntry2) ... better still, a ListBox might be better suited for such a selection (avoid invalid entry by user).
c) the rest of the code (i.e. appending the character associated with each click of a button on the keypad) would be the same as that posted by me previously.
If you need assistance with (b), let us know.
Here it is again.
I am not sure what exactly you are trying to do here ... tell me if my guess below is correct ...
When you have multiple "keypads" ...
a) you choose one particular "keypad" by typing in the number (of this keypad) in TextEntry2, which is then saved in variable [N]
b) you want to store/save [tempnumber] values for each "keypad" in variables [tempnumber[N]], and display them in Text7; which does not refresh when the compound variable changes.
Assuming that each of your "keypads" will be defined inside a separate container (like TempNumber), I suggest you ...
a) you assign the simple variable [tempnumber] to Text7 (and remove Number altogether) ... in other words, use a single object to show current input for all keypads.
b) in order to store/save the values of the "current keypad", you can swap them in/out of Text7 by altering [tempnumber] via event code associated with the change of "keypad" (i.e. TextEntry2) ... better still, a ListBox might be better suited for such a selection (avoid invalid entry by user).
c) the rest of the code (i.e. appending the character associated with each click of a button on the keypad) would be the same as that posted by me previously.
If you need assistance with (b), let us know.