Msgbox('The current user is not administrator. The correct use for your code would be: procedure InitializeWizard You can combine single and multiple statement blocks as well: if Condition then if Condition thenÄoSomethingElse // Semicolon optional hereÄ®nd // Semicolon required here unless the The semicolon is optional at the last statement in a block (although I typically include it even when it's optional, to avoid future issues when you add a line and forget to update the preceding line at the same time). Note that the first condition does not contain a terminating, as you're not yet ending the statement: if Condition then If you're executing a single statement, the begin.end are optional. (The above might be easier when you're first getting used to the syntax, though.) if Condition then begin If the file cannot be deleted or does not exist, the function returns False. You can shorten the number of lines used without affecting the placement, if you prefer. Prototype: function DeleteFile(const FileName: string): Boolean Description: Erases the file named by FileName from the disk. You have to match every begin with an end at the same level, like if Condition then I have read a few articles about it, and well I think I understand it and then I don't. Something from C++ or C# is probably creeping in from another part of my mind and messing up my understanding. I want to have a better understanding how to use these blocks. Sometimes I get it this kind of syntax right and it works out OK, but the problems become exasperated when nesting the if then else blocks. ![]() Of course if I remove the if then block and the begin end blocks associated with them then everything is OK. ![]() Msgbox('The current user is not administrator.', mbInformation, MB_OK) ![]() For example this gets me an Compiler Error "Identifier Expected". I can't seem to use the structure elements of the language correctly where I am nesting if then blocks using begin and end. It has been around 20 years since I last had to write in Pascal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |