Rockwell-automation 1747-PBASE BASIC Development Software Programming Uživatelský manuál Strana 77

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 144
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 76
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.
Zobrazit stránku 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 143 144

Komentáře k této Příručce

Žádné komentáře