
Arrays and Strings
32
Axcess Programming Language
You can place values into a storage location by setting the particular location equal to the needed
value. For example, CAM_PRESETS was previously defined as having six locations. If you want
the second location to hold a value of 6 you would type the following:
CAM PRESETS[2]=6
The number 6 is placed into the second location, as shown in FIG. 8.
From now on, anytime CAM_PRESETS[2] is referenced, its value is 6. In the example program,
pressing a Preset button either stores or recalls a preset. Examine the section of code that
accomplishes this:
DEFINE_VARIABLE
STORE_VOL_PRESET (* 1 WHEN WE STORE VOLUME PRESET *)
VOL_PRESETS[1Ø] (* 1Ø VOLUME PRESETS *)
VOL_PSET (* INDEX FOR ABOVE ARRAY *)
DEFINE_PROGRAM
PUSH[TP,32] (* STORE *)
STORE_VOL_PRESET = NOT STORE_VOL_PRESET
[TP,32] = (STORE_VOL_PRESET)
PUSH[TP,25] (* PRESET 1 *)
PUSH[TP,26] (* PRESET 2 *)
PUSH[TP,27] (* PRESET 3 *)
PUSH[TP,28] (* PRESET 4 *)
PUSH[TP,29] (* PRESET 5 *)
PUSH[TP,3Ø] (* PRESET 6 *)
PUSH[TP,31] (* PRESET 7 *)
{
VOL_PSET = PUSH_CHANNEL - 24
IF (STORE_VOL_PRESET)
VOL_PRESETS[VOL_PSET] = VOL_LEVEL
ELSE
SEND_COMMAND VOLUME,"'PØL',ITOA(VOL_PRESETS[VOL_PSET])"
OFF[STORE_VOL_PRESET]
}
The first PUSH [TP,32] is the Store button, which toggles the STORE_VOL_PRESET variable
using the NOT operator. The NOT operator inverts the state of whatever follows it. The PUSH
statement is immediately followed by a feedback statement for the Store button. The next seven
FIG. 7
The value in CAM_PRESETS[3] is assigned to the variable CAM_PRESET_1
FIG. 8
The storage location CAM_PRESET[2] is assigned a value of 6.
Содержание Axcess
Страница 1: ...instruction manual Software Axcess Programming Language ...
Страница 8: ...vi Axcess Programming Language Table of Contents ...
Страница 12: ...Introduction 4 Axcess Programming Language ...
Страница 22: ...Axcess Basics 14 Axcess Programming Language ...
Страница 38: ...Channel Characteristics 30 Axcess Programming Language ...
Страница 54: ...Levels 46 Axcess Programming Language ...
Страница 62: ...Operators 54 Axcess Programming Language ...
Страница 66: ...Variable Types and Conversions 58 Axcess Programming Language ...
Страница 70: ...Two Dimensional Arrays 62 Axcess Programming Language ...
Страница 80: ...While Keywords 72 Axcess Programming Language ...
Страница 86: ...Using Buffers 78 Axcess Programming Language ...
Страница 94: ...Waits and Timer Keywords 86 Axcess Programming Language ...
Страница 102: ...Using Subroutines 94 Axcess Programming Language ...
Страница 108: ...Include Files and System_Calls 100 Axcess Programming Language ...
Страница 120: ...Compiler Error Messages 112 Axcess Programming Language ...
Страница 124: ...The External_Control Protocol 116 Axcess Programming Language ...
Страница 143: ...Index 135 Axcess Programming Language ...