strins native - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: strins native (
/showthread.php?tid=105370)
strins native -
StrickenKid - 28.10.2009
Why is the strins function in string.inc tagged as a Boolean when that function is supposed to return a string?
Код:
native bool: strins(string[], const substr[], pos, maxlength=sizeof string);
Re: strins native -
roschti - 28.10.2009
Quote:
Originally Posted by <__Ǝthan__>
Why is the strins function in string.inc tagged as a Boolean when that function is supposed to return a string?
Код:
native bool: strins(string[], const substr[], pos, maxlength=sizeof string);
|
"string[]" is the base input & output string
Re: strins native -
StrickenKid - 28.10.2009
Well yes I already know that, that wasn't the question...
Re: strins native -
StrickenKid - 28.10.2009
Bill Gates told me:
http://msdn.microsoft.com/en-us/library/aa892194.aspx
Re: strins native -
Chaprnks - 28.10.2009
By the location of the bool, I think its for the return. Such as; if it was successfully inserted, it returns true.
Re: strins native -
Correlli - 28.10.2009
strins - Insert a sub-string in a string
Syntax: bool: strins(string[], const substr[], index, maxlength=sizeof string)
string The source and destination string.
substr The string to insert in parameter string.
index The character position of string where substr is inserted. When 0, substr is prepended to string.
maxlength If the length of dest would exceed maxlength cells
after in
Returns: true on success and false on failure. - that's why it's boolean tag.
Notes: During insertion, the substr parameter may be converted from a packed string to an unpacked string, or vice versa, in order to match string. If the total length of string would exceed maxlength cells after inserting substr, the function raises an error.
This can be found at (PAWN) String_Manipulation.pdf file.
Re: strins native -
dice7 - 28.10.2009
Your Bill Gates strins is different from sa:mp's one. Same as most functions in the includes you get with the server
Re: strins native -
StrickenKid - 28.10.2009
Quote:
Originally Posted by Don Correlli
strins - Insert a sub-string in a string
Syntax: bool: strins(string[], const substr[], index, maxlength=sizeof string)
string The source and destination string.
substr The string to insert in parameter string.
index The character position of string where substr is inserted. When 0, substr is prepended to string.
maxlength If the length of dest would exceed maxlength cells
after in
Returns: true on success and false on failure. - that's why it's boolean tag.
Notes: During insertion, the substr parameter may be converted from a packed string to an unpacked string, or vice versa, in order to match string. If the total length of string would exceed maxlength cells after inserting substr, the function raises an error.
This can be found at (PAWN) String_Manipulation.pdf file.
|
Thanks Don, that's what I wanted to know