View Full Version : How to use Compiler directives
05-01-2005, 06:13 PM
Here is another question that I was told could be accomplished.
SB5 apparently supports compiler directives now. One script can compile different versions. Again, I'd like to see some example code of this. It will clear things up quickly for me.
05-02-2005, 12:32 AM
Something like this:
#def DEMOVERSION = 1
#ifdef DEMOVERSION Equals "1" Then
Message Box "Add this if DEMOVERSION = 1" -- "Demo"
Message Box "Add this if DEMOVERSION = 0" -- "Demo"
Does this help?
05-02-2005, 01:51 AM
Ok. I was able to get a compiler directive to work . However, I think I need to use the #def Value Option "Get Value From Compiler Command Line", but don't know how to call the compiler via command line to pass the value itself.
I am hoping to accomplish the following:
A. Create one master script that can create multiple Installer versions of my app.
B. Be able to run the script by simply typing a command line prompt or clicking on a desktop shortcut that contains something like "sbuilder.exe /script=app_script.sb5 /defvalue=1".
I want to be able to have a non-technical person click on an shortcut icon and have my single-file image created shortly thereafter.
Am I heading in the right direction here with Compiler Directives?
05-02-2005, 02:02 AM
Aha, I see. I thought we are talking about passing variable values to the "installer". The command line compiler (by the way, both command line and IDE use the same compiler) will be part of the Gold version (Developer Edition only). You can then use "sbuilder.exe app_script.sb5 defvalue=1"
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.