Crestron SIMPL+ Dokumentacja Strona 40

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 60
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 39
Software Crestron SIMPL+
localStr = left(var3, 10);
}
Notice that the function shown above has three arguments, named var1, var2, and
var3. var1 and var2 are integers, while var3 is a string. Shown below is an example
of how to call this function from elsewhere in your program:
Call some_function( intVal1, 5+1, stringVal1);
Here we are assuming that the variable int1 has been defined as an integer earlier in
the program, as has the string variable, string1. Also note that the second argument is
a constant, and not a variable at all. This simply means that inside some_function,
the value of var2 will be set to 6.
ByRef, ByVal, and ReadOnlyByRef
When defining a function’s argument list, there are optional keywords you can use
which give you greater control over the behavior of the arguments. These keywords
are ByRef, ByVal, and ReadOnlyByRef.
What do these keywords mean? Essentially they describe the way that SIMPL+
passes variables to the function. When a function argument is defined as ByRef, any
variable that is passed to this argument will pass enough information about itself to
allow the function to modify the value of the original variable. The term ByRef is
used because we say a “reference” to the original variable is passed to the function.
This reference can be thought of the memory location where the original variable
lives. When a function argument is defined as “ByVal”, only the value of the
variable and not the variable itself is passed to the function, so the original variable
cannot be modified within the function. As an example, below is a function, which
takes two strings as arguments. It inserts one string into the other at a specified
character location:
FUNCTION insertString(ByRef STRING string1, ByVal STRING
string2, ByVal INTEGER position)
{
STRING leftpart[20], rightpart[20];
leftpart = left(string1,position);
rightpart = right(string1,position);
string1 = leftpart + string2 + rightpart;
}
In this example, note that only the first string argument, string1, was defined as
ByRef.
Functions That Return Values
To this point all user-defined functions we have discussed have had one thing in
common: when the functions are finished executing they do not return a value to the
calling code. This statement is ambiguous, because some of the functions do modify
the values of their arguments, and thus these modified variables can be used by the
calling procedure. However, the term return value is used to describe the core value,
which is returned from the function to the calling procedure. Many system functions
discussed earlier in this manual have return values. For example, here are some
statements that use the return values of functions:
36 SIMPL+
Programming Guide – DOC. 5789A
Przeglądanie stron 39
1 2 ... 35 36 37 38 39 40 41 42 43 44 45 ... 59 60

Komentarze do niniejszej Instrukcji

Brak uwag

Whirlpool LA79OOXT manuals

Owner’s manuals and user’s guides for Washing machines Whirlpool LA79OOXT.
We providing 1 pdf manuals Whirlpool LA79OOXT for download free by document types: Operations Instructions






More products and manuals for Washing machines Whirlpool

Models Document Type
8182748 Use and Care Guide     Whirlpool 8182748 Use & care guide, 68 pages
WMF 722 EU Instruction for Use    Whirlpool WMF 722 EU User manual [en] , 24 pages
OS 89 C IX Instruction for Use   Whirlpool OS 89D IX /HA Manuale utente [en] , 16 pages
XHP1550WR Use and Care Guide    Whirlpool XHP1550WR Use & care guide, 48 pages
AWG 652/WP - SERVICE Owner's Manual   Whirlpool AWG 652/WP - SERVICE Owner`s manual [en] , 16 pages
AQ9D 49 U H (EU)/VA Instruction for Use    Whirlpool AQ9D 49 U H (EU)/VA User manual [en] , 24 pages
LSR8433KQ1 User Manual   TOP AND CABINET PARTS [en] , 14 pages
LA6700XM Operations Instructions   Whirlpool LA6700XM Operating instructions, 12 pages
ARMXXD 1297 (RU) Instruction for Use   Whirlpool ARMXXD 1297 (RU) User manual, 12 pages
AQUALTIS AQ82F 29 Instruction for Use   Whirlpool AQ8L 29 U (FR) Manuel utilisateur, 12 pages
LSQ9620LG1 User Manual   TOP AND CABINET PARTS, 14 pages
AVL 120 (FR) Instruction for Use   Whirlpool AVL 120 (FR) Manuel utilisateur [en] , 12 pages
LST7233DQ0 User Manual   TOP AND CABINET PARTS, 12 pages
AV 52 Instruction for Use      Whirlpool FB 56 C.2 IX User manual, 72 pages
AVTL 83 (EU)/HA Instruction for Use      Whirlpool AVTL 83 (EU)/HA Manuel utilisateur, 72 pages
LSC8244EQ0 Specifications   Whirlpool LSC8244EQ0 Specifications, 28 pages
AQ7L 05 U Instruction for Use   Whirlpool AQ7L 09 I (IT) Manuale utente, 12 pages
2DLSQ7533JQ5 User Manual     washer installation instructions instrucciones para la, 16 pages
7MLSR5132JQ3 User Manual   TOP AND CABINET PARTS, 14 pages
LA528OXT Operations Instructions   Whirlpool LA528OXT Operating instructions, 16 pages