SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 12/06/2010, 07:57 PM   #1
ziomal432
Big Clucker
 
Join Date: Dec 2009
Posts: 172
Reputation: 0
Default String cuts when returning?

I've got this function,

pawn Code:
implode(glue, ...) //ported from PHP
{
    new RetString[256],
        GetString[64],
        GlueString[2],
        index;

    GlueString[0] = glue;
    for(new i = 1, c = numargs(); i < c; i++)
    {
        for(;;)
        {
            GetString[index] = getarg(i, index);

            if(GetString[index] == 0)
                break;

            index++;
        }

        strcat(RetString, GetString);
        strcat(RetString, GlueString);
        GetString[0] = '\0';
        index = 0;
    }
    printf("%s", RetString); //just little debug
    return RetString;
}

and
pawn Code:
print(implode(',', "123", "742", "638", "532", "167"));

Console shows
Quote:
[21:49:10] 123,742,638,532,167, <- showed by debug (in end of function)
[21:49:10] 167, <- returned
Is it because of stupidness of PAWN?
ziomal432 is offline  
 

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
strval returning 0 :( biltong Help Archive 3 08/04/2010 06:02 PM
[HELP] Command returning irc . trindade02 Help Archive 3 14/02/2010 11:13 PM
Help with returning after crash Jeka777 Help Archive 1 24/12/2009 02:36 PM
[Solved] Returning string SiJ Help Archive 2 05/08/2009 09:52 AM
Returning after crash Zocerman Help Archive 10 02/03/2009 06:17 PM


All times are GMT. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.