Welltech SIPIVR 6800GS V.2.1 User Manual
Page 111

110
Appendix D Pointer in Variable Declaration and
Expression component
We show an example that how to use the pointer access in Variable
Declaration
(option: Indirect) and Expression component.
Variable Declaration component
------------------------------------------- -------------------
Component_VariDeclare Result
------------------------------------------- -------------------
Indirect [] name=s1, type=str, value="cnt1" str s1 = "cnt1";
Indirect[v] name=s1, type=int, value= 0 int cnt1 = 0;
Expression component
------------------------------ -------------------
Component Expression Result
------------------------------ -------------------
cnt1 = 6
str1 = "test"
ptr = "str1" (indirect)
s = ptr
s = ptr; (s == ptr == "str1")
s = PtrStr(ptr)
s = str1; (s == str1 == "test" )
ptr = "cnt1"
s = ptr
s = ptr; (s == ptr == "cnt1")
n = PtrInt(ptr)
n = cnt1; ( n == cnt1 == 6 )
ptr = "cnt1"
S2VNAME (ptr) = 7 cnt1 = 7; (same as S2VNAME
("cnt1") = 7)
ptr = "str1"
S2VNAME (ptr) = "ok" str1 = "ok"; (same as S2VNAME
("str1") = "ok")
cnt1 = 7
ptr = "cnt1"
S2VNAME (ptr) = PtrInt(ptr) + 1 cnt1 = 7 + 1
str1 = "ok"
ptr = "str1"
S2VNAME (ptr) = PtrStr(ptr) + “!” str1 = “ok” + “!”
The cooperative between VariDeclare and Expression component
- Using the way, you can access variable via index like array
- For example, if you want to use the statistic favorite option after
played
"Press 1 for xx, press 2 for xx..., press 9 for xx",
Just use three components: Expression, VariDeclare, and
Expression
- Expression: s = "n" + sRecvDigit
----->s == "n1", "n9"
- VariDeclare: VariName=s; Type=int; Value=0; click pointer/indirect
-----> declare n1, n2 ... n9; initial value is 0