Text -5, Text – Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 77

Advertising
background image

Publication 1746-PM001A-US-P

Writing Programs Using the BASIC Development Language 6-5

Syntax:

{$L [labelname]}

Example:
Before translation:

After translation:

REM LABEL EXAMPLE

0 REM ...

IF A>C THEN GOTO GET_C_VALUE

10 REM LABEL EXAMPLE

A=55

20 IF A>C THEN GOTO 40

{$L GET_C_VALUE}

30 A=55

C=107

40 C=107

Text

The Text directive allows you to include commands like RUN and LIST in your
program. When translated, these commands are not given line numbers; but they
are included in the output file. As the file is downloaded to the BASIC or
BASIC-T module, these directives are executed as soon as they are encountered.

Syntax:

{$T [command for module]}

Example:
Before translation:

After translation:

REM TEXT COMMAND EXAMPLE

0 REM ...

{$I INCLUDE.BDL}

10 REM TEXT COMMAND EXAMPLE

FOREGROUND_BLACK()

20 PRINT CHR(27),“[30m”,

BACKGROUND_RED()

30 PRINT CHR(27),“[41m”,

CLS()

40 PRINT CHR(27),“[2J”,

A=55

50 A=55

C=107

60 C=107

{$T RUN}

RUN

In the above example, immediately after the file is downloaded, the RUN
command is encountered and executed.

Advertising