5 declaration statements, 6 functions, 1 function definition – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 92

Advertising
background image

labeled-statement

:

##

identifier

5.5.4.5

Maestro

Software Manual

MAXL Program Language

MAN-MASSW (Ver. Q)

Declaration Statements

Declaration statements introduce new names into the current function. Before using
global variable inside function it must be declared by keyword global.

Syntax

declaration-statement:

global type name-list

type name-list

type:

int

float

name-list:

name

name-list , name

Multiple declarations of the same name in the same function are illegal.

5.6

Functions

5.6.1

Function Definition

A function definition specifies the name of the function, the types and number of
arguments it expects to receive, and types and number of return arguments. A
function definition also includes a function body with the declarations of its local
variables, and the statements that determine what the function does.

function-definition:

function function-name ( argument-list )

function-body
end function

function [ type variable-name ] = function-name ( argument-list )

function-body

end function

function [ argument-list ] = function-name ( argument-list )

function-body

end function

argument-list:

type name
argument-list , type name

function-body:

5-30

Advertising