Rockwell-automation 1747-PBASE BASIC Development Software Programming Manuel d'utilisateur Page 96

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 95
Publication 1746-PM001A-US-P
8-2 Translating Your Program
The software checks the extension of the file in the active edit window and prompts
you to select a translator/compiler.
The file in the active edit window is always saved prior to translating. Other open,
altered files may be saved if the translator is configured to save all files as discussed
in the last section of this chapter.
Once selected, the translator/compiler translates the source code you have written
in the BASIC Development Language into BASIC. The translator:
removes comments
adds BASIC line numbers
replaces labels with line numbers
brings in include files
expands programming macros
checks for syntax errors
For example, the translator will accomplish these tasks in the following program:
Figure 8.1 Second Program, Before Translation (SECOND.BDL)
REM SECOND PROGRAM
{will print screen below, then check operator number}
{$I Include.bdl}
{screen setup}
background_Black( )
High_Intensity ( )
foreground_Yellow ( )
cls()
{print statements}
print
P.tab(10),”
P.tab(10),”WARNING
P.tab(10),”Use of this machine is restricted“
P.tab(10),”
hit_any_key( )
{pause and wait for keystroke}
cls()
{$L loop1}
Print “Enter your Operator Number”
{pause and wait for input}
get_key (op)
{check for input of 49 or 50 which are ASCII decimal for 1 or 2}
if op=49 then goto op1setup
if op=50 then goto op2setup
{print error and loop back for another entry}
cls()
print “Invalid Entry..Operator number not recognized”
goto loop1
{$L op1setup}
IMPORTANT
The 1747-PBASE Translator expects your filename to have a
.BDL extension. If it does not, you get an error.
Vue de la page 95
1 2 ... 91 92 93 94 95 96 97 98 99 100 101 ... 143 144

Commentaires sur ces manuels

Pas de commentaire