Denso BHT-200QW Especificações Página 76

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 587
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 75
68
5.3 User-defined Functions
Out of user-defined functions, the SUB and FUNCTION functions can be called from other files.
The DEF FN function can be called only in the file where that function is defined and should
start with an FN.
The DEF FN and FUNCTION functions are classified into three types: integer functions, real
functions, and character functions, each of which should be defined in the following format:
User-defined Function
Format of DEF FN Format of FUNCTION
Integer functions
Real functions
Character functions
FN
FN
FN
functionname %
functionname
functionname $
Setting Character String Length o
Setting Character String Length oSetting Character String Length o
Setting Character String Length of Returned Values of Character Functions
f Returned Values of Character Functionsf Returned Values of Character Functions
f Returned Values of Character Functions
A character function may return 1 through 255 characters. Note that the default character
string length results in the returned value of 40 characters.
If the returned value of the character string length is always less than 40 characters, you can
use the stack efficiently by setting the actual required value smaller than the default as the
maximum length. This is because the Interpreter positions returned values on the stack during
execution of user-defined functions so as to occupy the memory area by the maximum length
size. To define a function which results in the returned value of one character, for example,
describe as follows:
DEF FNshort$(i%)[ 1]
On the other hand, if the returned value is more than 40 characters, it is necessary to set the
actually required length. To define a function which results in the returned values of 128
characters, for example, describe as follows:
DEF FNlong$(i%)[128]
Dummy Arguments and Real Arguments
Dummy Arguments and Real ArgumentsDummy Arguments and Real Arguments
Dummy Arguments and Real Arguments
Dummy arguments are used for defining user-defined functions. In the example below, i% is a
dummy argument.
DEF FNfunc%(i%)
FNfunc%=i%*5
END DEF
Real arguments are actually passed to user-defined functions when those functions are called.
In the example below, 3 is a real argument.
PRINT FNfunc%(3)
Vista de página 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 586 587

Comentários a estes Manuais

Sem comentários