View Single Post
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-30-2010 , 11:41   Re: #define string in string
Reply With Quote #15

Quote:
Originally Posted by Frus View Post
Can't you put a parameter in the function to specify the maximum length of the returned string?
How do you exactly do that? Sample code:

PHP Code:
String:DoSomething(maxlen) {
    
decl String:buffer[128]
    new 
len FormatEx(buffer,sizeof(buffer),"blabla")

    if(
len maxlen) {
        
buffer[maxlen] = 0
    
}

    return 
buffer

Wouldnt that still return the whole 128 byte array?

Quote:
Originally Posted by Frus View Post
EDIT: grey, isn't that function returning a single character, not a string?
It returns the string.
__________________
plop
p3tsin is offline