Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Set & let
It should be 7.
If you are ever unsure, it is worth testing out on your own. If you run this using the debugger it will show you how the different parts of this are executed and how the variable changes.
Hi,
vValue is a string because 1+2 is between " ' " (and you are using SET instead of LET)
So you couldn't do a sum.
So at the end:
vValue = '1+2'
vSum = '+4'
@StarinieriG vValue gets replaced with the string in the vSum LET expression.
So:
Let vSum = $(vValue) + 4;
Turns into:
Let vSum = 1+2 + 4;
Debugger window to visualize:
If you take the script:
Sub A
SET vValue = '1+2';
EndSUB
Sub B
Let vSum = $(vValue)+4;
EndSub;
Sub C
let vValue=;
let vSum=;
EndSub
Set vValue=56;
CALL A; Call B;
Trace ------------------ vValue = $(vValue) | vSum = $(vSum);
It will return:
This may be crazy, but here are the Help links for Set and Let, maybe seeing the official doc will help solidify the delta, I know I struggled with them at first as well...
Cheers,
Brett