Statement: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(→‎Control Structure: Note for advanced readers)
m (→‎Control Structure: Advanced note moved into Control structures.)
Line 23: Line 23:
     [[hint]] "oh no";
     [[hint]] "oh no";
  }
  }
''Note for advanced readers: in OFP/ArmA/VBS scripting language control structures are normal scripting commands. The distinction is only logical, not like in most imperative programming languages, where control statements are implemented in the core language grammar. The "controlling" done by them is implemented by accepting [[Code|code]] as an argument. The complex control structures like "[[while]] ... [[do]] ..." are implemented using helper types, like [[While Type]].''


=== Command ===
=== Command ===

Revision as of 12:29, 2 May 2007

A statement is a piece of scripting code. It is an instruction to the script interpreter and tells it to do something.

Types of Statements

A statement can be:

Value Assignment

A value assignment to a variable.

_variable = ...

Control Structure

Any control structure including its blocks.

if (_value > _limit) then
{
    hint "oh no";
}

Command

Any scripting command including its arguments.

player sideChat "hello";