call – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:


:::Sorry, I meant always for this command and not always in the whole game. The note should be added to this article that strings only are allowed in OFP for this command. --[[User:T D|T_D]] 12:06, 23 October 2006 (CEST)
:::Sorry, I meant always for this command and not always in the whole game. The note should be added to this article that strings only are allowed in OFP for this command. --[[User:T D|T_D]] 12:06, 23 October 2006 (CEST)
:::EDIT: Str already add examples for OFP and ArmA. Didn't see that, sorry --[[User:T D|T_D]] 12:09, 23 October 2006 (CEST)

Revision as of 12:09, 23 October 2006

I think the description should be changed because call is not just used for calling functions. Furthermore the command compile should be mentioned for ArmA because functions can be precompiled in this way like:

_myFunc = compile preprocessFile "myFunc.sqf"
[1,3] call _myFunc

This should be a little bit faster than doing it without to compile the function at least if the compile command works as I expect it.


Examples

Example 1 and 3 won't work in ArmA as the string has to be transfered to code before:

_fAdd = compile loadFile "add.sqf" [1,2] call _fAdd

or

_fAdd = loadFile "add.sqf" [1,2] call compile _fAdd

and

_n = 3; call compile format [{var%1 = 0},_n];

--raedor 22:58, 22 October 2006 (CEST)

That would mean you always have to use code instead of strings, but then we should add a note that using strings is only allowed in OFP. --T_D 00:27, 23 October 2006 (CEST)
Not always; but everywhere where code is required ;) E.g. you always have to compile "loadFiles" as loadFile returns strings. onMapSingleClick for example still requires strings... it's Poseidon, you know... :D --raedor 02:20, 23 October 2006 (CEST)
Sorry, I meant always for this command and not always in the whole game. The note should be added to this article that strings only are allowed in OFP for this command. --T_D 12:06, 23 October 2006 (CEST)
EDIT: Str already add examples for OFP and ArmA. Didn't see that, sorry --T_D 12:09, 23 October 2006 (CEST)