11.08.2010, 15:04
Quote:
As you should know - PAWN is NOT a sub-language of C++. PAWN is a typeless imperative language, C++ is a typed object oriented language. Both PAWN (through SMALL-C/SMALL) and C++ are based on C, but they have nothing to do with each other directly. That's like saying a TV is a type of microwave because they're both based on electricity, or that gorrilas are a type of human because they're both descended from primative primates. PAWN and C++ followed very different develpoment paths from C and saying they're related is just misleading and wrong!
Also, starting a tutorial with "this is boring" is NOT a good start! And there are [pawn] and [code] tags you can use instead of code and quote (and pawn gives syntax highlighting). And your very first example will not run - there is no "main" function, which is more important that OnGameModeInit. Fundamental data types <- PAWN is typeless, there is only one type, the cell. This section is entirely redundant. Strings are not special arrays, they are just arrays. And characters are not 1 byte big, as I just said there is only one type in PAWN - the cell, so characters are one cell big (excluding packed strings, but they're rarely mentioned). '\0' is not two characters - it is one character, the '\0' character. PAWN has native array bounds checking - accessing an array element which doesn't exist will not crash the server it will give an error in the console. // is not known as a line comment (at least not in any documentation I've ever seen) - "called by me" and "known as" are not the same thing - this is a "stream" comment. Block comment is accurate. print is not an output stream - I can tell you've lifted that straight from the C++ tutorial, where streams do exist. print is an output function. void is not a reserved word - this only has meaning in a typed language, and PAWN is typeless. class is not a reserved word - this only has meaning in an object oriented language such as C++, which PAWN is in no way related to. It is the "SA-MP wiki" - "wiki" is a noun, "wikipedia" is a trademark name for one wiki. The major missing section in here is control flow - you're not going to get very far in coding without "if" or "for" etc. -2147483648 is not poorly defined in PAWN, it is just a number, it is however not well handled by the printf function - which is part of the SA-MP API, NOT part of PAWN. PAWN defines the syntax and operators used, the SA-MP library is a set of functions within the PAWN language construct - separating these two is very important. The pawn homepage is here: http://www.compuphase.com/pawn/pawn.htm and makes no mention of SA-MP or most of the functions anywhere. That site also includes the infamous PAWN language guide: http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf - which I suggest you read thoroughly! Some bits were good though. |