Closed Se8870 closed 2 years ago
Good idea! I was planning something like that for the next version. However, it should also follow the naming scheme like the rest of the functions do - task_await_str
should store the string into an array, and task_await_str_s
should be the function to return String:
.
Good idea! I was planning something like that for the next version. However, it should also follow the naming scheme like the rest of the functions do -
task_await_str
should store the string into an array, andtask_await_str_s
should be the function to returnString:
.
So, it should become this:
new result[size];
await_str(result) AnyTaskFunction();
new String:str = await_str_s AnyTaskFunction();
to follow the naming scheme?.
But i think it should be like this:
new result[size], String:str;
await_str(result) AnyTaskFunction();
await_str_s(str) AnyTaskFunction();
Why? it's because normal string macro is await_str(result)
and not await_str
. So it became much sense if we can treat it same as the normal string.
How do you think about it @IllidanS4?
No no, the reason for the (result)
argument is simply that you cannot return an array from a function without lots of issues that go with it. But obtaining a single-cell value doesn't have to go through all this hassle and so await_str_s
should correspond to simple await
and await_var
.
Oh i see, okay i'll change it.
Ok, it's done! 😄
it should be added since there is
task_get_result_str_s();