1. Whats wrong with this?
- Posted by Allen Ashby <allenannashby at comcast.net> Jun 27, 2007
- 618 views
When I use the following code
procedure onClick_btnOpen(integer self, integer even, sequence parms) object ind2 sequence sel integer ind,ind3 sel=getTVSelectedText(TV) ind=findItem(LV2,sel,1) setText(inv7,ind) ind3=getNumber(inv7) setIndex(LV2,ind) ind2=getLVAllText(LV2,ind3) setText(inv6,ind2) end procedure setHandler( btnOpen, w32HClick, routine_id( "onClick_btnOpen" ))
I get the following error sequence to be poked must only contain atoms What am I doing wrong anybody? Thanks Allen
2. Re: Whats wrong with this?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 27, 2007
- 628 views
Allen Ashby wrote: > > > When I use the following code > > }}} <eucode> > procedure onClick_btnOpen(integer self, integer even, sequence parms) > object ind2 > sequence sel > integer ind,ind3 > sel=getTVSelectedText(TV) > ind=findItem(LV2,sel,1) > setText(inv7,ind) > ind3=getNumber(inv7) > setIndex(LV2,ind) > ind2=getLVAllText(LV2,ind3) > setText(inv6,ind2) > end procedure > setHandler( btnOpen, w32HClick, routine_id( "onClick_btnOpen" )) > </eucode> {{{ > > I get the following error > > sequence to be poked must only contain atoms > > What am I doing wrong anybody? The setText() routine needs the second parameter to be a simple string of text, but the getLVAllText() function returns a sequence of strings. So in effect it is something like ... ind2 = getLVAllText(LV2, ind3) -- ind2 is set to {"abc", "foo", "bar"} setText(inv6, ind2) -- fails. If what you are trying to do is display all the columns of text in a single EditText field then try this instead ... ind3 = "" for i = 1 to length(ind2) do ind3 &= ind2[i] ind3 &= " " -- separate the columns out. end for setText(inv6, ind3) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
3. Re: Whats wrong with this?
- Posted by Allen Ashby <allenannashby at comcast.net> Jun 27, 2007
- 614 views
Derek Parnell wrote: > > Allen Ashby wrote: > > > > > > When I use the following code > > > > }}} <eucode> > > procedure onClick_btnOpen(integer self, integer even, sequence parms) > > object ind2 > > sequence sel > > integer ind,ind3 > > sel=getTVSelectedText(TV) > > ind=findItem(LV2,sel,1) > > setText(inv7,ind) > > ind3=getNumber(inv7) > > setIndex(LV2,ind) > > ind2=getLVAllText(LV2,ind3) > > setText(inv6,ind2) > > end procedure > > setHandler( btnOpen, w32HClick, routine_id( "onClick_btnOpen" )) > > </eucode> {{{ > > > > I get the following error > > > > sequence to be poked must only contain atoms > > > > What am I doing wrong anybody? > > The setText() routine needs the second parameter to be a simple string of > text, > but the getLVAllText() function returns a sequence of strings. So in effect > it is something like ... > > ind2 = getLVAllText(LV2, ind3) > -- ind2 is set to {"abc", "foo", "bar"} > setText(inv6, ind2) -- fails. > > If what you are trying to do is display all the columns of text in a single > EditText field then try this instead ... > > ind3 = "" > for i = 1 to length(ind2) do > ind3 &= ind2[i] > ind3 &= " " -- separate the columns out. > end for > setText(inv6, ind3) > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell Thanks Derek. This really helped. Allen