I am using Else If in my old setups - the command still works with the new InstallAware.
It is however missing in the commands list ... why?
Else if?
There were some very subtle bugs with this command. We didn't have time to fully fix them, so we removed it from the production builds, but as you notice, it is still available for backwards compatibility reasons. We do recommend that you replace all else-if commands in your script with an else and then a new if block.
Re: Else if?
Seven years later, "else if" is still listed in the help file, but not available as a command in the editor? I am using the latest version.
Is "else if" supposed to work or not?
Using if with multiple else will not work from what I can see. It will indent fine in editor, it will compile fine but not execute more than one else. In the example below the last else will never execute.
Don't know if I am totally blind at the moment, but I had to resolve this with some really ugly code using goto:s everywhere.
In my opinion "else if" is a useful command.
Regards,
Is "else if" supposed to work or not?
Using if with multiple else will not work from what I can see. It will indent fine in editor, it will compile fine but not execute more than one else. In the example below the last else will never execute.
Don't know if I am totally blind at the moment, but I had to resolve this with some really ugly code using goto:s everywhere.
Code: Select all
if Variable ENHET Equals 1
if Variable isIE10 Equals TRUE
do stuf
else
do stuff
end
else
if Variable ENHET Equals 2
if Variable isIE10 Equals TRUE
do stuff
else
do stuff
end
end
else
if Variable isIE10 Equals TRUE
this will never execute
else
nor will this
end
end
In my opinion "else if" is a useful command.
Regards,
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Else if?
Dear User,
Unfortunately, "else if" is still not available ... and not because not useful.
Anyway, have you tried doing as?;
Regards
Unfortunately, "else if" is still not available ... and not because not useful.
Anyway, have you tried doing as?;
Code: Select all
if Variable ENHET Equals 1
if Variable isIE10 Equals TRUE
do stuf
else
do stuff
end
if Variable ENHET Equals 2
if Variable isIE10 Equals TRUE
do stuff
else
do stuff
end
end
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Else if?
OK, then I know. Would be nice if "else if" would be reimplemented at some point in the future
Your example does not handle the case when ENHET does not equal 1 or 2 (the last else in my example) and since IA does not support logical operators in "If" I saw no other solution than using labels and Goto:s (or using yet another variable).
Anyways, the example really isn't important I mostly wanted to find out the status of "else if" since it was listed in the help file.
Regards,

Your example does not handle the case when ENHET does not equal 1 or 2 (the last else in my example) and since IA does not support logical operators in "If" I saw no other solution than using labels and Goto:s (or using yet another variable).
Anyways, the example really isn't important I mostly wanted to find out the status of "else if" since it was listed in the help file.
Regards,
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Else if?
Dear User,
In reality the "Else If" statement used to exist.
It can still be loaded from scripts that use it (generated with past IA versions). However, it cannot be added to new scripts.
You can also use "Evaluate Expression" command where you can evaluate expressions as;
$A$ = "value1" or ($B$ = "value2" and $C$ = "value3")
Hope his helps you.
Regards
In reality the "Else If" statement used to exist.
It can still be loaded from scripts that use it (generated with past IA versions). However, it cannot be added to new scripts.
You can also use "Evaluate Expression" command where you can evaluate expressions as;
$A$ = "value1" or ($B$ = "value2" and $C$ = "value3")
Hope his helps you.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 122 guests