Hi, I would appreciate a pointer to what might be wrong with implementing my function.
I wrote and tested a script but when I try to convert it for use as a function I get an error. I then wrote a simple test script to see if I could narrow it down but get the same error. Can anyone tell me what I'm doing wrong.
Here's the simple test and what I'm doing.
In init.sqs I've declared the following:
int = preprocessFile "int.sqf"
The function int.sqf contains:
private ["_h"];
_h = (_this) - (_this mod 1);
_h
I call this from a script like this:
_i = [9.33] call int
hint format ["Here is your integer sir: %1",_i]
The error I get with this and my original function is:
error call : [9.33] |#| call int, Type string, expected code
From what I've read on functions or looking at other examples I am doing it as others appear to be doing it but I just can't get past this error or figure out where the so called 'string' instead of code is being detected.
Any ideas would be appreciated.
regards
L