Raised This Month: $ Target: $400
 0% 

#define string in string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-30-2010 , 11:41   Re: #define string in string
Reply With Quote #16

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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode