This website uses cookies. By clicking Accept, 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
- :
- IF Statement
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- 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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2011
08:26 AM
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2011
09:33 AM
thanks you are correct, all lowercase solved the problem. Thanks.
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)