This website uses cookies. By clicking OK, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: IF Statement
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
hh1234
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
May 11, 2011
03:29 PM
IF Statement
I have this code:
begin
VerGetFileVersion("C:\\Windows\\Notepad.exe",svVer);
// MessageBox("Notepad Version is "+svVer,0);
MessageBox(svVer,0);
If (svVer != "500") then
MessageBox("Your notepad.exe version is ", svVer);
endif;
end
If I Remove the If THEN EndIf part it compiles fine and works. But my IF statement is wrong and it won't compile. I've tried many different syntax formats for my IF Statement and I have not found the correct format yet. I keep getting a "IF" Undefined Identifier error.
What did I mis-code here?
Thanks.
begin
VerGetFileVersion("C:\\Windows\\Notepad.exe",svVer);
// MessageBox("Notepad Version is "+svVer,0);
MessageBox(svVer,0);
If (svVer != "500") then
MessageBox("Your notepad.exe version is ", svVer);
endif;
end
If I Remove the If THEN EndIf part it compiles fine and works. But my IF statement is wrong and it won't compile. I've tried many different syntax formats for my IF Statement and I have not found the correct format yet. I keep getting a "IF" Undefined Identifier error.
What did I mis-code here?
Thanks.
2 Replies
ch_eng
Flexera beginner
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
May 12, 2011
08:26 AM
Re: IF Statement
It looks like the problem is that you capitalized "If". It should be lowercase. Also, the MessageBox call isn't correct but the one in your comment block looks correct. Here's an alternate way:
HTH
if (svVer != "500") then
MessageBox("Your notepad.exe version is " + svVer, INFORMATION);
endif;
HTH