Escape sequences not working when loading strings from a MySQL table to a dialog?
#8

Interesting, I got it working when I tested with this code:
pawn Code:
new str[ 128 ];
    strins( str, "hello\nthere", 0 );
    Fix( str );
    printf( "STRING: %s", str );
However, but not when using the shortcut
pawn Code:
printf( Fix( "hello\nthere" ) );
So using, in your code, Fix(caption), it should work correctly. Try printing that in the console too, when you put it into the dialog, and see if it shows a line in the console.

Here is the stock function I tested with:
pawn Code:
Fix( string[ ] )
{  
    for( new i = 0, j = strlen( string ); i < j; i++ )  
    {      
        if( string[ i ] == '\n' )      
        {        
            strdel( string, i, i + 1 );
            strins( string, "\n", i, 1 );
        }  
    }
    return string;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)