Y_master
#1

How do i define and use functions with a string as the return.

With this i have one error in the main script ( argument type mismatch) (no errors in FS):

Код:
foreign getSomeString();

global getSomeString() {
 new test[20];
 test = "This is a test";
 return test;
}
Reply
#2

*bump
Reply
#3

pawn Код:
global getSomeString(&test[]) {
    test = "This is a test";
}
Use:
pawn Код:
new str[20];
getSomeString(str);
print(str);//Will print "This is a test"
Reply
#4

Clever ,but:

Код:
 "variable cannot be both a reference and an array"
Reply
#5

Quote:
Originally Posted by detter
Посмотреть сообщение
Clever ,but:

Код:
 "variable cannot be both a reference and an array"
You're right, I forgot about that. Strings can't be references... I've never played with y_master too much so I don't know what to say...

Perhaps you should report this on github.
Reply
#6

As Crayder said, Create an issue in the github with a Question tag and ****** himself will help you.
Reply
#7

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
As Crayder said, Create an issue in the github with a Question tag and ****** himself will help you.
No... It's not a question. This is a real issue. Strings seem to not be able to be returned in y_master functions. There's also no need to tag ******, he checks the YSI github regularly.
Reply
#8

Thank you for your suggestion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)