You are here

Meaning of ${|} define\variable

3 posts / 0 new
Last post
nfs911
Offline
Last seen: 6 years 11 months ago
Joined: 2017-12-01 16:12
Meaning of ${|} define\variable

Hello!
Studying the source code (PortableApps.comLauncher), I came across a ${|} and don't understand meaning of ${|} also not can find documentation of this.
This like as OR? When i see this into end of expression - not sure that understand meaning. Finding in source code, this forum, help files and search engine not get results.

demon.devin
demon.devin's picture
Offline
Last seen: 4 years 3 months ago
Developer
Joined: 2007-08-02 09:04
Read the LogicLib documentation.

That little define is made available thanks to the LogicLib.nsh header file.

You will usually see this used along side the ${IfThen} define.

Here are some examples:

;= This will only execute the !echo instruction if there were errors
${IfThen} ${Errors} ${|} !echo "This will only show if there are errors!" ${|}

;= This will check to see if the process "MyProcess.exe" is running.
;= If it is running then it'll terminate it.
${IfThen} ${ProcessExists} MyProcess.exe ${|} ${TerminateProcess} MyProcess.exe $0 ${|}

;= This one will check the host PC if it's running Windows XP or later.
;= If the check fails, it'll show a message box with the error message.
${IfNotThen} ${AtLeastWinXP} ${|} MessageBox MB_OK "ERROR: You need WinXP or greater to continue.." ${|}

So you can see that ${|} is just a means for the ${IfThen} to end it's conditional instructions.

You can always search the LogicLib's source code to see for yourself.

Hope this helps!

Smile

daemon.devin

nfs911
Offline
Last seen: 6 years 11 months ago
Joined: 2017-12-01 16:12
Thank you very much!

Ooh, at last it made sense! It's strange that I did not notice this dependence. Thank you very much!

Log in or register to post comments