Rockwell-automation 2708-NBD VBASIC Language Development Kit Manual de usuario Pagina 48

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 84
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 47
Appendix A
A-B VBASIC and Visual BASIC Tips
A2
The programmer assumed that this statement would clear the second line of
the display and then print This is a test. But, this is not what actually
happens! This is compiled as:
CL2 : PRINT This is a test ;
where CL2 is a local label which is effectively ignored.
The rule should be NEVER have a line which looks like:
< identifier > : < rest of line >
unless you INTEND for <identifier> to be a label.
CONSTant Declarations
CONST name = value does not quite follow the same rules as variable
assignments in the same position. The major difference is that the type of
name is determined by the contents of value. A DEFINT or DEFSNG #,
or $ after the name to set the type explicitly. The trailing symbol is NOT
required when the constant is referenced.
PRINT text; : <statement>
A problem for Pascal and C programmers is coding: PRINT text,
<statement> instead of: PRINT text; : <statement>
If the statement is a function such as e = ReadStr%(3,s$) then the result is
for e to retain its previous value, and for an extra 0 or 1 to follow the printed
text.
Vista de pagina 47
1 2 ... 43 44 45 46 47 48 49 50 51 52 53 ... 83 84

Comentarios a estos manuales

Sin comentarios