Available on: all targets

PROC

This keyword has multiple meaning. If the identifier that follows this command is not already defined, this can be used to give a label (name) to a part of the program. This makes subprograms independent of their position in the program and makes it easier for the programmer to keep track of things (names are easier to assign to a purpose than line numbers).

The PROC command is used to define the name of such a subprogram (or jump target). Following the convention in other BASICs of the time, such as Simon's BASIC or Tuned Simon's BASIC, the procedure name can also contain spaces. In this case, the trailing space will not be considered as part of the name.

If, instead, the identifier has been already used for a procedure, then this command will call the procedure, as the instruction CALL.

SYNTAX

 PROC name


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 PROC factorial


Used in:

ABBREVIATION: Prb

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

PROC ↔ Prb

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS