Just run the code below.
Code: Select all
Let>a=Hello everybody
Let>b={"a"}
MDL>%b%
MDL> %b%
Moderators: JRL, Dorian (MJT support)
Code: Select all
Let>a=Hello everybody
Let>b={"a"}
MDL>%b%
MDL> %b%
Code: Select all
//VAREXPLICIT 0 implied
Let>a=Hello everybody
Let>b={"a"}
MDL>%b%
MDL> %b%
MDL>b:%b%
Let>VAREXPLICIT=1
MDL>%b%
MDL> %b%
MDL>b:%b%
I did get the same behavior for these two cases:1. Why does the command interpreter change the behaviour when an extra space is used?
How does interpreter distinguish the "final" variable value (Hello everybody) from "intermediate" value (a)
You indicate the braces are part of the password.2. Suppose I have the result of third party app password crypting. Something like this:
{~@%$#*!?} (this is random string! not the expression)
I need to write this string to Windows registry.
So, I make the code...
///
Let>MyPass={~@%$#*!?}
Let>REG_INTASSTR=1
RegistryWriteKey>HKEY_CURRENT_USER,TestMacro,UserPass,MyPass
///
... then I run it ... and I get syntax error.
Just run this codeAre you sure you removed trailing spaces on all statements?
Code: Select all
Let>MyPass={"{~@%$#*!?}"}
MDL>%MyPass%
Code: Select all
Let>MyPass={"{~@%$#*!?}"}
MDL>MyPass
What's wrong with my example? If it is correct why the error occured?Do this:
Let>MyPass={"{~@%$#*!?}"}
MDL>MyPass
Code: Select all
PutClipBoard>{~@%$#*!?}
GetClipBoard>RandomPass
Let>MyPass={"RandomPass"}
MDL>Generated(crypted) password is %MyPass%
MDL>Generated(crypted) password is MyPass
Code: Select all
PutClipBoard>{"{~@%$#*!?}"}
GetClipBoard>RandomPass
Let>MyPass=RandomPass
MDL>Generated(crypted) password is %MyPass%
MDL>Generated(crypted) password is MyPass
Code: Select all
PutClipBoard>{"{~@%$#*!?}"}
GetClipBoard>RandomPass
MDL>Generated(crypted) password is %RandomPass%
Code: Select all
Input>inp_pass,Enter a password beginning with { and ending in }
PutClipBoard>inp_pass
GetClipBoard>RandomPass
MDL>Generated(crypted) password is %RandomPass%
Code: Select all
// I get unpredictable string content from clipboard
GetClipBoard>RandomPass
// I set MyPass variable to be sure this data will be interpret as a string
Let>MyPass={"RandomPass"}
// Then I save this variable in text file
WriteLn>C:\SavedPass.txt,nWLNRes,Generated password is %MyPass%
Code: Select all
// I get unpredictable string content from clipboard
GetClipBoard>RandomPass
// I set MyPass variable to be sure this data will be interpret as a string
Let>MyPass={%RandomPass%}
// Then I save this variable in text file
WriteLn>C:\SavedPass.txt,nWLNRes,Generated password is %MyPass%
So, there is no need to use MyPass variable at all. The code below works fine.Because RandomPass is meant to be a variable name it should be enclosed in percents rather than quotes.
Code: Select all
// I get unpredictable string content from clipboard
GetClipBoard>RandomPass
// Then I save this variable in text file
WriteLn>C:\SavedPass.txt,nWLNRes,Generated password is %RandomPass%