Function – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
How can engine know if I want to use standard or semicolon free variation? In both is first command semicoloned... --[[User:Djura|Djura]] 19:34, 24 July 2006 (CEST)
How can engine know if I want to use standard or semicolon free variation? In both is first command semicoloned... --[[User:Djura|Djura]] 19:34, 24 July 2006 (CEST)
:There is no semicolon free in function-based syntax. Watch the examples, they all have semicolons to separate instructions. When no semicolon, it's a curled-brace, ie an "embedded" function line, or set of instruction. The semicolon free syntax exists in current OFP-style scripts, launched by [[exec]]. If I'm not mistaken, once you launch things through [[call]], [[spawn]] or [[execVM]], you're using function syntax that '''requires''' semicolons to separate instructions. If you still use "[[exec]]", you're using OFP-style syntax --[[User:Whisper|Whisper]] 19:44, 24 July 2006 (CEST)

Revision as of 19:44, 24 July 2006

How can engine know if I want to use standard or semicolon free variation? In both is first command semicoloned... --Djura 19:34, 24 July 2006 (CEST)

There is no semicolon free in function-based syntax. Watch the examples, they all have semicolons to separate instructions. When no semicolon, it's a curled-brace, ie an "embedded" function line, or set of instruction. The semicolon free syntax exists in current OFP-style scripts, launched by exec. If I'm not mistaken, once you launch things through call, spawn or execVM, you're using function syntax that requires semicolons to separate instructions. If you still use "exec", you're using OFP-style syntax --Whisper 19:44, 24 July 2006 (CEST)