Old 27th February 2013, 07:44   #1
Junior Member
Join Date: Feb 2013
Posts: 1
Using Funtions in Compile Time

I got the date functions from the NSIS site (http://nsis.sourceforge.net/Manage_dates_as_numbers) and would like to get the today serial value during compile time.

I envisioned running the script as follows:


!define day
!define !DaySerial `!insertmacro _!DaySerial`
!macro _!DaySerial _SERIAL
Call TodaySerial
Pop ${_SERIAL}
DetailPrint ${_SERIAL}
${!DaySerial} day

But I am getting an error on the call:
Error: command Call not valid outside Section or Function
Error in macro _!DaySerial on macroline 1
Apparently, the CALL command cannot be executed from a compile time macro.

My question is: How can I call the function in compile time?


davidhary is offline   Reply With Quote
Old 27th February 2013, 08:13   #2
Major Dude
Join Date: Oct 2006
Posts: 1,892
You cannot call a function at compile time. You can however call an executable at compile time, using !execute or !system. So you can let your script run a compiled NSIS exe which writes "!define Foo bar" to an nsh file, and then you !include that nsh file after you !execute the exe.
MSG is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

compile, function, macro

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump