Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQF code is wrong #6

Open
X39 opened this issue Mar 19, 2021 · 0 comments
Open

SQF code is wrong #6

X39 opened this issue Mar 19, 2021 · 0 comments

Comments

@X39
Copy link
Collaborator

X39 commented Mar 19, 2021

Should be

params ["_method", "_args"];
private _result = "";
private _longResult = nil;
// do a call for an extra variable scope
0 call {
    ("extFileIO" callExtension [_method, _args]) params ["_resultData", "_returnCode", "_errorCode"];
    if (_errorCode != 0) then { throw _errorCode; };
    switch _returnCode do {
        case -1: { _result = (parseSimpleArray ("[" + _resultData + "]")) select 0; throw _result; };
        case 0: { _result = (parseSimpleArray ("[" + _resultData + "]")) select 0; };
        case 1: { _longResult = (parseSimpleArray ("[" + _resultData + "]") select 0; };
    };
};
// while in long result, keep polling
while { !isNil "_longResult" } do
{
    ("extFileIO" callExtension ["?", _longResult]) params ["_resultData", "_returnCode", "_errorCode"];
    if (_errorCode != 0) then { throw _errorCode; };
    switch _returnCode do {
        case -1: { _result = (parseSimpleArray ("[" + _result + _resultData + "]")) select 0; throw _result; };
        case 0: { _result = (parseSimpleArray ("[" + _result + _resultData + "]")) select 0; _longResult = nil; };
        case 1: { _result = _result + _resultData; };
    };
};
_result```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant