[Tutorial] Ellipsis Operator (" . . . ")
#6

Quote:
Originally Posted by Vince
View Post
I expected to see the other use of the ellipsis operator; array initialization. Perhaps you could do a section on that, too?
@Vince - True, I never really used Elepsis Operator before on but after reading this thread I learned how to use numargs and getarg, anyways is this what you mean?

pawn Code:
/*
    0xFF = 255
    INVALID_MENU = 255
    INVALID_GANG_ZONE = -1
    INVALID_PLAYER_ID = 65535
    INVALID_VEHICLE_ID = 65535
    INVALID_OBJECT_ID = 65535
    INVALID_TEXT_DRAW = 65535

*/


new
    array[ 4 ] = {0xFF, ... } //Mostly used in arrays
;

main()
{
    printf("%i | %i | %i | %i", array[ 0 ], array[ 1 ], array[ 2 ], array[ 3 ]);
    array[ 0 ] = 1, array[ 1 ] = 2, array[ 2 ] = 3, array[ 3 ] = 4;
    printf("%i | %i | %i | %i", array[ 0 ], array[ 1 ], array[ 2 ], array[ 3 ]);
}
Output
pawn Code:
255 | 255 | 255 | 255
1 | 2 | 3 | 4
Reply


Messages In This Thread
Ellipsis Operator (" . . . ") - by ACI - 04.01.2014, 19:00
Re: Ellipsis Operator (" . . . ") - by ACI - 04.01.2014, 19:20
Re: Ellipsis Operator (" . . . ") - by ACI - 05.01.2014, 13:24
Re: Ellipsis Operator (" . . . ") - by Hansrutger - 05.01.2014, 13:36
Re: Ellipsis Operator (" . . . ") - by Vince - 05.01.2014, 17:38
Re: Ellipsis Operator (" . . . ") - by Patrick - 05.01.2014, 18:21
Re: Ellipsis Operator (" . . . ") - by ACI - 06.01.2014, 11:22
Re: Ellipsis Operator (" . . . ") - by Ada32 - 06.01.2014, 11:52
Re: Ellipsis Operator (" . . . ") - by ACI - 06.01.2014, 12:09
Re: Ellipsis Operator (" . . . ") - by Ballu Miaa - 06.01.2014, 12:23

Forum Jump:


Users browsing this thread: 2 Guest(s)