hh1234
Level 5

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.
Labels (1)
0 Kudos
2 Replies
ch_eng
Level 7

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:

if (svVer != "500") then
MessageBox("Your notepad.exe version is " + svVer, INFORMATION);
endif;


HTH
0 Kudos
hh1234
Level 5

thanks you are correct, all lowercase solved the problem. Thanks.
0 Kudos