Raised This Month: $ Target: $400
 0% 

Can somebody explain this to me?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-19-2018 , 22:30   Re: Can somebody explain this to me?
Reply With Quote #1

Quote:
Originally Posted by blAck. View Post
Since I'm new, I was wondering what does 'sz' stands for?
I've seen some stuff like szName, szNameReceiver, szAmount, szCommand...
Please can somebody explain this to me?
"string, zero-terminated"

Meaning that the end of the string is denoted by a value of zero. This is why you must always size an array being used as a string with one extra element (for the zero-termination).

Code:
szString[7] = "hello"

string[0] = 'h' = 104
string[1] = 'e' = 101
string[2] = 'l' = 108
string[3] = 'l' = 108
string[4] = 'o' = 111
string[5] = EOS = 0
string[6] =
I didn't show a value for string[6] because it is ignored because it comes after the zero-termination; it could be any value.

Prefixing is not required but because Pawn is typeless, it is generally recommended to prefix your variable so that people, including yourself, know what you are actually using the variable for.

Other often used prefixes:

Code:
integer:  i
boolean:  b
Float:  f
string:  sz
For more about basic Pawn programming, you should look through the tutorials. This one is really good. Other tutorials can be found here.
__________________
fysiks is offline
Reply



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 12:34.


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