PDA

View Full Version : How to define a variable?



Mauricio
06-04-2007, 07:54 AM
Hi all,
as you can see, I'm starting with SB. I saw in the examples (dialog2, for example) a dialog window for a password that save the result in a variable (%_SB_PASSWORD%). I looked for in the script but I couldn't find where that variable is defined.
I read the help too but I didn't find anything.
So, any help will be appreciated.
Thanks in advance.

Mauricio

linder
06-04-2007, 08:06 AM
Mauricio,

%_SB_PASSWORD% is a pre-defined variable (no need to define it again). See Script Editor -> Script Variables list. All "blue" items are pre-defined runtime variables.

You can create your own variables in the Script Editor (wherever you want, just make sure it is declared before you use it).

Does this help?

BTW, the use of the %_SB_PASSWORD% variable in "Dialog Demo 2.sb6" is only an example. In fact, there is no need to really check the password using an If Statement. You can just check the "Auto-verify Password" option (Advanced tab in the Dialog Properties) to automatically let the installer check the validity of the entered password.

Friedrich

Mauricio
06-04-2007, 08:14 AM
Hi,
I need a dialog window where the user will enter 4 variables. So, I need to define this variable before using them. How? Where? :)
Thanks again.

Mauricio

linder
06-04-2007, 08:20 AM
Mauricio,

Just use the "Set Variable..." script item in the Script Editor and create the four variables before you use them (wherever you want). Then, in your dialog, select the required variable(s). In other script functions, you may use <Ctrl><Right Mouse Button> to open a variable list.

Does this help?

Friedrich

Mauricio
06-04-2007, 08:31 AM
Thanks Friedrich,
that is what I wanted!!!
Last question: how can I protect the password entry? I want to see the ****. I know that I have a different dialog for password but I'd like to know if I can do it in the same window.
Thanks again.

Mauricio

linder
06-04-2007, 08:59 AM
Mauricio,

Please try the "Wizard: Set Control Properties" function (see "Set Control Properties.sb6" demo script on how to use it).

There is a "Set Password Style" option. You can use this option to set the ****

Does this help?

Friedrich

Mauricio
06-05-2007, 02:29 AM
Hi again,
I saw the wizard but, obviously, I have a new question. You use, in the example, this:
Set Password Style to Control ID $USER_EDIT3$
Question is: where is defined the control ID $USER_EDIT3$? Because I couldn't find it in the script.
In my window I store the value in a variable called %MCS_PASSWORD% and, again, I couldn't find any place where to find the control ID for that variable.
Thanks again.

Mauricio

linder
06-05-2007, 02:37 AM
Hi Mauricio,

Just open the "Common Definitions.sbi" in your Script Editor (script tab).

Check the Standard Wizard Dialog Control IDs.

Does this help?

Friedrich

Mauricio
06-05-2007, 02:56 AM
Thanks!!! It worked fine!!! :)