 |
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 12, 2007 3:36 pm
working from a stringlist |
Ok latest thing is trying to use some info i am capturing in string variable
ok my variable looks like this now
ok my trigger has pattern
#addkey trial001 {test1=%1|test2=%2|test3=%3}
#addkey trial002 {test1=%4|test2=%5|test3=%6}
this gives me a load of variables which are data records with 2 columns
so at @trial001
test1 | 4
test2 | 5
test3 | 4
@trial002
test1 | 14
test2 | 345
test3 | 0
etc etc I am using the test1 test2 etc as simple text
it is the 2nd column in the data records that change constantly
so my question is how do I reference jus the 2nd column eg 4, 5, 4, 14, 345 and 0.
I want to be able to make some more alias that do things like
eg
#if (the number at trail002 test2) eg 345 > (the number at trial001 test1) eg 4 then do this
#if (the number at trail002 test2) eg 345 = (the number at trial001 test1) eg 4 then do that
#if (the number at trail002 test2) eg 345 < (the number at trial001 test1) eg 4 then do the other
if not clear am sorry hope you can help  |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 12, 2007 3:47 pm |
If this isn't clear I'll explain more.
Code: |
#if (%db(@trial002,test2)=%db(@trial1,test1)) {do this} {#if (%db(@trial002,test2)>%db(@trial1,test1)) {do this} {do that}} |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 12, 2007 3:53 pm |
Post deleted because I don't enjoy making a tit of myself.
VV Apparently not enough :( |
|
Last edited by Fang Xianfu on Mon Feb 12, 2007 4:06 pm; edited 1 time in total |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 12, 2007 4:04 pm |
Urm Fang, that is legal syntax he is using. The question was how do you reference a key value pair. The answer being.
%db(@Variable,Keyname) or @Variable.Keyname
#var trial001 {test1=%1|test2=%2}
Creates a STRING LIST that you cannot reference the way he is describing.
Did you sleep last night man? *offers you a pillow* |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 12, 2007 6:43 pm |
guess as usually I am doing something wrong or missing something
first im wondering if i am capturing it wrong my trigger text as above
produces a data record the left column of this is test1 test2 test3 as above
and the right column is the numbers that change
if I use
alias name ztest
(value below)
#if (%db(@trial001,test1)=%db(@trial002,test1)) {say test equal} {#if (%db(@trial001,test1)>%db(@test002,test2)) {say test1 greater} {say test2 greater}}
doesnt work so i guess i need a different reference at (@trial001,test1) etc or change trigger
ps I dont need to create variables for test1 test2 etc do I as the appear in data record? |
|
|
 |
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 12, 2007 6:48 pm |
ah hang on do i need more than say test equal to make me actually say something
|
|
|
 |
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 12, 2007 6:54 pm |
sorry I am a dumbass i needed to make it #show test equal not say test equal thanks and wow i actually have something working now cool
|
|
|
 |
|
|