call – Talk
Jump to navigation
Jump to search
mNo edit summary |
Lou Montana (talk | contribs) m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ") |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Examples== | == Examples == | ||
Example 1 and 3 won't work in ArmA as the string has to be transfered to code before: | Example 1 and 3 won't work in ArmA as the string has to be transfered to code before: | ||
Line 36: | Line 36: | ||
::::: Indeed, especially as the first Syntax is wrong for ArmA. Maybe we should remove the first syntax, as the alternative one is correct and working for both ArmA and OFP; we still can leave the link to load/preprocessFile there, but IMHO those two don't have to do anything with the syntax of call (as the command does not care if you're writing the code/string there directly or if it is loaded from some external file). --[[User:Raedor|raedor]] 21:16, 23 October 2006 (CEST) | ::::: Indeed, especially as the first Syntax is wrong for ArmA. Maybe we should remove the first syntax, as the alternative one is correct and working for both ArmA and OFP; we still can leave the link to load/preprocessFile there, but IMHO those two don't have to do anything with the syntax of call (as the command does not care if you're writing the code/string there directly or if it is loaded from some external file). --[[User:Raedor|raedor]] 21:16, 23 October 2006 (CEST) | ||
::: Added call body and call code commands to separate both flavours. | :::: Added call body and call code commands to separate both flavours. I referred to the official ArmA comref supplied by BI for the operand names and types and also for the return values. Anything to add should be added as soon as possible. The previous call command has not yet been removed. | ||
I referred to the official ArmA comref | |||
Anything to add should be added as soon as possible. | |||
The previous call command has not yet been removed. | |||
[[User:Planck|Planck]] 21:44, 23 October 2006 (CEST) | ::::[[User:Planck|Planck]] 21:44, 23 October 2006 (CEST) | ||
::::: Probably it is better to make two pages; but I suppose we should not differ between code/function body, as it is the same. We rather should differ between ArmA and OFP (call_arma and call_ofp). Then we can put both variants, "pure" code and "loaded" code, on one page (as syntax and alternative syntax). I'll set it up, you guys can decide which "system" is better. --[[User:Raedor|raedor]] 00:50, 24 October 2006 (CEST) | |||
:::::: Both syntaxes, ''pars call body'' and ''call code'' are relevant to OFP and ArmA. If you look in the old OFP comref and the newer ArmA comref you will find both variants listed. I don't really see the need for seperate OFP and Arma, they work in both. | |||
::::::[[User:Planck|Planck]] 15:21, 24 October 2006 (CEST) | |||
::::::: I just don't see the difference between the "code" and "body" syntaxes, as they're both exactly the same: "body" is nothing more than "code", loaded from an external file... anyway. ;) --[[User:Raedor|raedor]] 16:50, 24 October 2006 (CEST) |
Latest revision as of 19:22, 31 January 2021
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)
- We need to identify the which examples are for ofp and which are for ARMA. I think it can be easily done by simply changing the |example 1 . Or we could split the commands back into two commands and name them properly. Right now this command seems really confusing. hoz 16:27, 23 October 2006 (CEST)
- Indeed, especially as the first Syntax is wrong for ArmA. Maybe we should remove the first syntax, as the alternative one is correct and working for both ArmA and OFP; we still can leave the link to load/preprocessFile there, but IMHO those two don't have to do anything with the syntax of call (as the command does not care if you're writing the code/string there directly or if it is loaded from some external file). --raedor 21:16, 23 October 2006 (CEST)
- Added call body and call code commands to separate both flavours. I referred to the official ArmA comref supplied by BI for the operand names and types and also for the return values. Anything to add should be added as soon as possible. The previous call command has not yet been removed.
- Planck 21:44, 23 October 2006 (CEST)
- Probably it is better to make two pages; but I suppose we should not differ between code/function body, as it is the same. We rather should differ between ArmA and OFP (call_arma and call_ofp). Then we can put both variants, "pure" code and "loaded" code, on one page (as syntax and alternative syntax). I'll set it up, you guys can decide which "system" is better. --raedor 00:50, 24 October 2006 (CEST)
- Both syntaxes, pars call body and call code are relevant to OFP and ArmA. If you look in the old OFP comref and the newer ArmA comref you will find both variants listed. I don't really see the need for seperate OFP and Arma, they work in both.
- Planck 15:21, 24 October 2006 (CEST)
- I just don't see the difference between the "code" and "body" syntaxes, as they're both exactly the same: "body" is nothing more than "code", loaded from an external file... anyway. ;) --raedor 16:50, 24 October 2006 (CEST)