Contexts

Each expression is evaluated in a particular context which defines which properties are available. Using the context references, you can temporarily switch to a different context to access another object's properties. For example, `Ship(2).Name' yields the name of ship 2, regardless where you are.

If the argument to a context reference is out of range or EMPTY, the return value is EMPTY. Use this to your advantage.

In addition, context references are used with the `With' statement. There it is an error for a context reference to return EMPTY.

Since PCC 1.0.18, context references use singular words. The older plural words (`Ships(id)') continue to be available, but I recommend you to use the new form for new programs: it is more consistent with `ForEach', and PCC2 will only accept the new form (because it's consistent, that is).

Since PCC 1.1.18, you can optionally prefix context references with `Global.' (i.e. `Global.Ship(2).Name'). This feature exists for forward-compatibility with PCC2.

Beam(id).FIELD

Evaluate the specified field as a beam property. Id is the numeric beam Id, between 1 and 10. If the value is out of range or EMPTY, the result is EMPTY. Also available as `Beams(id)'.

See also: Beam weapon properties

Engine(id).FIELD

Evaluate the specified field as an engine property. Id is the numeric engine Id, between 1 and 9. If the value is out of range or EMPTY, the result is EMPTY. Also available as `Engines(id)'.

See also: Engine properties

Hull(id).FIELD

Evaluate the specified field as a starship hull property. Id is the numeric hull Id, between 1 and 105. If the value is out of range or EMPTY, the result is EMPTY. Also available as `Hulls(id)'.

See also: Hull properties

InMsg(id).FIELD

Evaluate the specified field as a property of the specified incoming message. Message numbers range from 1 to `My.InMsgs'.

See also: Message properties

Launcher(id).FIELD

Evaluate the specified field as a torpedo launcher property. Id is the numeric torpedo system Id, between 1 and 10. If the value is out of range or EMPTY, the result is EMPTY. To access torpedoes, use `Torpedo(id)'. Also available as `Launchers(id)'.

See also: Torpedo system properties

Minefield(id).FIELD

Evaluate the specified field as a minefield property. Id is the minefield Id, possible values are 1 to 500 (1 to 10000 in latest PHost). If nothing is known about the specified minefield, or id is out of range or EMPTY, the result is EMPTY. Also available as `Minefields(id)'.

See also: Minefield properties

Planet(id).FIELD

Evaluate the specified field as a planet property. If the specified Id is invalid or EMPTY, the result is EMPTY. Also available as `Planets(id)'.

See also: Planet properties, Starbase properties

Player(id).FIELD

Evaluate the specified field as a player property. Id is the player number, from 1 to 11. This is a way to access other players' scores from a script. Also available as `Players(id)'.

See also: Player Properties

Ship(id).FIELD

Evaluate the specified field as a starship property. If the specified Id is invalid or EMPTY, the result is EMPTY. Also available as `Ships(id)'.

See also: Ship properties

Storm(id).FIELD

Evaluate the specified field as an ion storm property. Id is the storm Id, ranging from 1 to 50. If the specified storm does not exist, the result is EMPTY. Also available as `Storms(id)'.

See also: Ion Storm properties

Torpedo(id).FIELD

Evaluate the specified field as a torpedo property. Id is the numeric torpedo system Id, between 1 and 10. If the value is out of range or EMPTY, the result is EMPTY. To access torpedo launchers, use `Launcher(id)'. Also available as `Torpedoes(id)'.

See also: Torpedo system properties

Ufo(id).FIELD

Evaluate the specified field as a property of the (first) Ufo with the given Id.

See also: Ufo properties


[ << Previous | Up | Next >> ]

Stefan Reuther <Streu@gmx.de>