Default value for a variable

Common questions about using Actual Installer.

Default value for a variable

Postby UFa » Wed Feb 03, 2021 2:05 pm

I use INPUTBOX to request a number to be entered by the user, which is stored in the variable <MyCnter>. If the user makes no input, the variable <MyCnter> should be filled with the default value 1.
Populating DefaultData with 1 doesn't seem to work, since I output an MSG with the variable <MyCnter> after the INPUTBOX. IF an input is made, it shows up in the MSG output as well.
What am I doing wrong or have I not understood?
Thanks for any support.

Regards,
Uli
UFa
 
Posts: 6
Joined: Tue Dec 08, 2020 10:09 am

Re: Default value for a variable

Postby Leo » Sat Feb 13, 2021 12:54 pm

When using MSG in the Default Data field, add [x], where x - it's a default data.
Leo,
Actual Installer Team
http://www.actualinstaller.com
Leo
Site Admin
 
Posts: 381
Joined: Fri Jan 22, 2010 12:40 pm

Re: Default value for a variable

Postby UFa » Tue Mar 02, 2021 9:26 am

Leo, thank you very much for your answer.
Unfortunately, I do not understand it. Perhaps I have not formulated my request precisely.
So: I want to know from the user via INPUTBOX how many instances he wants to install. I store his answer in the variable <MyCnter>. If he makes no input here, <MyCnter> should take a default value of 1. In the next step I output a window with the command MSG. In this window the variable <MyCnter> (which contains the user input OR the default value of 1) is displayed.
The problem now is that I can't see a default value (value: 1) at MSG when the user didn't made any input.
What am I doing wrong?
Thanks already once for your efforts.

Kind regards,
Uli


Translated with http://www.DeepL.com/Translator (free version)
UFa
 
Posts: 6
Joined: Tue Dec 08, 2020 10:09 am

Re: Default value for a variable

Postby Leo » Mon Mar 08, 2021 12:28 pm

In this case you need two entries in Variables:

1.
Variable: <MyCnter>
Reg Key: INPUTBOX
Reg Value: your text
Default Data: 1

2.
Variable: <MyCnter2>
Reg Key and Reg Value leave empty
Default Data: MSG(your text <MyCnter>)
Leo,
Actual Installer Team
http://www.actualinstaller.com
Leo
Site Admin
 
Posts: 381
Joined: Fri Jan 22, 2010 12:40 pm

Re: Default value for a variable

Postby UFa » Mon Mar 15, 2021 2:39 pm

Thank you for your response, Leo.
I already used those 2 variabels as you suggested, but the second variable (<MyCnter2>) does not show up in the MSG (windows) the content of <MyCnter> with the Deault value '1' if nothing (= left blank) is entered in INPUTBOX with <MyCnter>.
If I am entering any number in the INPUTBOX dialog this number is shown in the MSG.
The expected default value of '1' for <MyCnter> seems to be lost when displaying with MSG (your text <MyCnter>) as there is no content displayed with(in) <MyCnter>.
Any idea?
UFa
 
Posts: 6
Joined: Tue Dec 08, 2020 10:09 am

Re: Default value for a variable

Postby UFa » Tue May 11, 2021 10:08 am

I still can't get it to display the preassigned value in the INPUTBOX. Can I kindly get some more help here? Thank you very much.
UFa
 
Posts: 6
Joined: Tue Dec 08, 2020 10:09 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron