Page 1 of 1
Flow Control - If Statement not obeying logic
Posted: Thu Jan 28, 2010 6:17 pm
by mathim
Attached is a pdf file with a InstallAware debug run. For some reason the 'if statement' is not being evaluated correctly.
This occurs two places in the script. In both cases the 'if statements' always evaluates to true.
I have commented out some lines to simplify the problem.
The Variable OLDVER is set to FALSE and the 'if statement'
tests for TRUE. It should not be executing the block of code.
What am i doing wrong to cause this?
Thanks for any help
Mickey
[/img][/list]
File Attached:
why.pdf
Posted: Thu Jan 28, 2010 9:09 pm
by ekoindri
Can you copy paste your script as text for your issue?
Posted: Thu Jan 28, 2010 10:53 pm
by mathim
ekoindri wrote:Can you copy paste your script as text for your issue?
~InstallAware Clipboard Data~
~Set Variable~
~{00473979-7BB6-48BA-B7DA-6AEF4E07B53E}~
~OLDVER$MYAH$MYAH$FALSE~
~FALSE~
~If~
~{2615B82B-A21D-4EC3-A67C-6F35966D78E2}~
~OLDVER~
~0~
~TRUE~
~FALSE~
~Delete Files Recursive~
~{57318144-45D7-440F-A455-7577CC10CBC3}~
~$PROGRAMFILES$InstallShield Installation Information\\{A3D5ACE1-7778-4E4A-9FF1-614C335888E5}\\*.*~
~End~
~{4083E029-71EE-4539-A72B-DDBFE5A80803}~
Posted: Fri Jan 29, 2010 12:06 am
by ekoindri
Let you track the variabel with tihs script:
Code: Select all
~InstallAware Clipboard Data~
~Comment~
~{6BD8E45A-6F11-4AF8-B759-2AF393E6BE7A}~
~~
~End~
~{3AD76BCA-041E-4B8F-85DF-AAD6264AC97D}~
~MessageBox~
~{549FB749-EE62-4F18-A363-FCDAA3A6FA8F}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~Else~
~{DBAA91EB-412C-445F-ADAC-8EFCA0F02757}~
~Set Variable~
~{B73DB431-06A5-494A-BA70-D243C50EE2D7}~
~OLDVER$MYAH$MYAH$FALSE~
~FALSE~
~MessageBox~
~{EF07E1FF-BA25-4F40-BCAF-FDEAB306606D}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~If~
~{34B4753A-9DD1-4EFE-91CF-C42BDCBAE5DF}~
~OLDVER~
~0~
~TRUE~
~FALSE~
~Comment~
~{D02D0349-A558-4428-AFB8-8FFD6586DEA7}~
~~
~MessageBox~
~{DAD2E2DD-581F-485F-A094-AEC551AD9E98}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~Comment~
~{E1A64593-1A4D-4FE7-B8A7-34514F3F1D32}~
~~
~Delete Files Recursive~
~{9B006877-AF38-4824-BCAE-FDD76D27E0B5}~
~$PROGRAMFILES$InstallShield Installation Information\\{A3D5ACE1-7778-4E4A-9FF1-614C335888E5}\\*.*~
~Comment~
~{09A02BB8-F228-42CE-887B-778E023F061C}~
~~
I'm sure that installaware give the information correctly and maybe you misunderstanding with the process.
Make sure that you variabel
OLDVER has been intialized or set before.
regards,
//ekoindri
Posted: Fri Jan 29, 2010 12:53 pm
by mathim
ekoindri wrote:Let you track the variabel with tihs script:
Code: Select all
~InstallAware Clipboard Data~
~Comment~
~{6BD8E45A-6F11-4AF8-B759-2AF393E6BE7A}~
~~
~End~
~{3AD76BCA-041E-4B8F-85DF-AAD6264AC97D}~
~MessageBox~
~{549FB749-EE62-4F18-A363-FCDAA3A6FA8F}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~Else~
~{DBAA91EB-412C-445F-ADAC-8EFCA0F02757}~
~Set Variable~
~{B73DB431-06A5-494A-BA70-D243C50EE2D7}~
~OLDVER$MYAH$MYAH$FALSE~
~FALSE~
~MessageBox~
~{EF07E1FF-BA25-4F40-BCAF-FDEAB306606D}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~If~
~{34B4753A-9DD1-4EFE-91CF-C42BDCBAE5DF}~
~OLDVER~
~0~
~TRUE~
~FALSE~
~Comment~
~{D02D0349-A558-4428-AFB8-8FFD6586DEA7}~
~~
~MessageBox~
~{DAD2E2DD-581F-485F-A094-AEC551AD9E98}~
~Get variabel information~
~Information : $OLDVER$~
~0~
~1~
~~
~Comment~
~{E1A64593-1A4D-4FE7-B8A7-34514F3F1D32}~
~~
~Delete Files Recursive~
~{9B006877-AF38-4824-BCAE-FDD76D27E0B5}~
~$PROGRAMFILES$InstallShield Installation Information\\{A3D5ACE1-7778-4E4A-9FF1-614C335888E5}\\*.*~
~Comment~
~{09A02BB8-F228-42CE-887B-778E023F061C}~
~~
I'm sure that installaware give the information correctly and maybe you misunderstanding with the process.
Make sure that you variabel OLDVER has been intialized or set before.
regards,
I think i understand the process - the variable is initialized - see the debug run. if the variable was not initialized it would not show in the debugger watch list windows.
Posted: Fri Jan 29, 2010 2:01 pm
by mathim
I removed some commented lines of code and now it works as expected.
I don't understand why this occurred but it fixed the problem. Commented lines should not be executed and should have NO affect on the code or flow control. Apparently the commented lines did affect the execution.
Posted: Fri Jan 29, 2010 7:56 pm
by ekoindri
Hello mathim,
Good luck if your question already solved.
Btw, are you sure that your comments in your project have been executed as command?
Can you show me the snippet of your script? Because I still do not believe if the comment line executed as command.
regards,
\\\\ekoindri
Posted: Sat Jan 30, 2010 11:56 am
by mathim
ekoindri wrote:Hello mathim,
Good luck if your question already solved.
Btw, are you sure that your comments in your project have been executed as command?
Can you show me the snippet of your script? Because I still do not believe if the comment line executed as command.
regards,
\\\\ekoindri
Look at the attached pdf file. It should be clear. OLDVER is FALSE and the IF tests for TRUE - back to the question - why is it in the 'IF' block?
When i removed comments at the beginning of the program it altered the behavior. Again why?
Posted: Mon Feb 01, 2010 8:35 am
by ALive
Hi, everyone!
I get rarely such issues. Later I found that the problem was in Localization mechanism. If you occasionally translate the value for certain IF statement for "FALSE" value to be "TRUE" then it'll always be TRUE.
Make sure that you don't have this IF statement translated (inside translator tool).
IMO, best of all is to use VARSONLY mode. Using it i've saved hours of unnecessary debugging.
P.S. Btw, the way you can reproduce this is to write down the code with IF statement then translate it, and then change the logic inside IF clause. As said before I've got a couple situations like that. If NOT in VARSONLY mode, be careful with translator.
Hope this helps!