11.07.2015 Views

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

BCL Programmers Manual V2.00 (PDF) - Barix

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Read more about types and variables in sections 11 and 14.3.2.2 Procedures and functionsBuilt-in <strong>BCL</strong> procedures are called by the procedure name optionally followed by commaseparatedprocedure parameters. E.g.:WRITE 1,a$,10Procedures do not return any value.Built-in functions as well as user defined functions are called by their name, followed by theopening bracket '(' (ASCII 0x28), an optional comma-separated list of function parametersand closed by the closing bracket ')' (ASCII 0x29).Functions always return a value (a string or an integer) and therefore can be called in anexpression. Functions can be called as a statement, in which case the return value isdiscarded.Examples:l=LEN("Hello world!")a$="Total sum is "+STR$(a)my_function()' function call in an assignment' function call in an expression' user function called as a statementRead more about user defined functions in chapter , more about integer functions in chapter4 and more about string functions in chapter 5.6.3.2.3 Conditional statementsConditional program execution is achieved by using IF-THEN-ELSE construct. For example:IF a100 THENSYSLOG "String too large"GOSUB 2000ENDIFRead more about conditional statements in chapter 6.53.2.4 Program flow controlProgram flow can be controlled by the following statements: GOTO, GOSUB-RETURN, FOR-NEXT.GOTO is an unconditional jump to a specific label. Label is a unique numeric mark in theprogram .Example:10SYSLOG "Current time is "+SPRINTF$("%1t",0)DELAY 1000GOTO 10<strong>Barix</strong> AG | 9/106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!