You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Pawn (programming language)

From EverybodyWiki Bios & Wiki

Script error: No such module "Draft topics". Script error: No such module "AfC topic".

Pawn
ParadigmProcedural programming, Structured programming
DeveloperCompuPhase
First appeared1998; 26 years ago (1998)
Stable release
4.0.5749 (3rd april 2020)
Typing disciplineweak typing
OSCross-platform
LicenseApache License
Filename extensions.pwn, .p
Websitehttps://www.compuphase.com/pawn/pawn.htm
Influenced by
C, Small-C

Search Pawn (programming language) on Amazon.

PAWN is an open source programming language developed in 1998[1] by the dutch company CompuPhase.
The language was called Small until release 3, published march 2005.

PAWN is distributed under the Apache License.

General concepts[edit]

PAWN has a syntax similar to C[2] and strongly influenced by Small-C[3]

The source code, usually contained in a .pwn file, is processed by the compiler. An .amx file containing the bytecode generated during the compile time will be created, it requires the virtual machine to be executed.

The package available on the official site contains the Quincy IDE which allows the compilation of the source files (.p or .pwn) and contains a debugger.

Usage[edit]

PAWN is used by some online project as the main development tool. For example, it's used together with C++ as the main programming language for development on the unofficial mod for Grand Theft Auto: San Andreas, "San Andreas Multiplayer"[4]. Using PAWN, servers can create gamemodes that communicate with the client in ways the singleplayer mode doesn't allow. It's also used for the unofficial Grand Theft Auto: Vice City mod "Vice City MultiPlayer"[5], and for scripting in the Half-Life AMX Mod X and SourceMod.

Examples[edit]

'Hello World':

#include <core>
main() 
{
    print("Hello World!");
    return 0;
}

This will write 4 random numbers to the console:

#include <core>
main() 
{
    new digit[4]; // Creates a vector (array) with four elements (0, 1, 2 and 3)
    for(new i=0; i<4; i++) // Starts a for loop with four loops
    {
        digit[i] = random(500); // index i of digit will be a value between 0 and 499
        printf("Digit %d's value is %d.", i, digit[i]); // Prints to console
    }
    return 0; 
}

References[edit]

  1. history.txt distributed together with the documentation
  2. "The Pawn language". Retrieved 8 March 2008.
  3. ""The Pawn Booklet: 1. Language Guide"" (PDF). Archived from the original (PDF) on 14 August 2012.
  4. "SA-MP San Andreas Multiplayer mod for Grand Theft Auto (GTA SA)". Retrieved 2015-08-05.
  5. "Vice City: Multiplayer". Archived from the original on 5 April 2006. Retrieved 2015-08-05.


This article "Pawn (programming language)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Pawn (programming language). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.