aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1014

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1014  Use of ListChoice

14/12/2004 @ 13:22
by Mike Featherstone

Anonymous



The ListChoice command permits specification of a 'initial selection' string which is displayed by default! whenever the control is invoked. I had assumed that this was intended to provide a default selection (i.e. one of the items from the list) but as it doesn't seem to affect the returned value, I think I must be wrong.

Is the use of this parameter for displaying inital prompts such as 'Select one of the following' rather than seeding an initial result?
Write to Mike Featherstone   Post an answer  Top

[]   


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
14/12/2004 @ 23:16
by aldweb

Anonymous

visitor
Mike,

Yes, the 'initial selection' string is intended to provide a default selection.

Then, I am not sure I understand you exactly. But, let me try to answer anyway and please don't hesitate to ask for more details or to correct my answer.

The default selection is only managed in terms of rendering on the screen. It is up to your source code to store and remember what is the real status of a LISTCHOICE selected item, with the help of the SELECTEDCHOICE function.

The last selection made in a LISTCHOICE is only set for the last LISTCHOICE event (you could have more than one LISTCHOICE in one form) and it has to be captured right away with SELECTEDCHOICE (as explained that quickly in the user manual...).

Here is an example.
Let's assume, we have 2 LISTCHOICEs in a form, #1 and #2.
Then:

REPEAT
E=WAITEVENT
IF E=1 LET A=SELECTEDCHOICE : GOSUB _DoSomethingWithIt
IF E=2 LET B=SELECTEDCHOICE : GOSUB _DoSomethingWithIt
UNTIL E=-1

This is fine, we store in A and B the selected item for each of the 2 LISTCHOICEs.

REPEAT
E=DOEVENTs
IF E=1 GOSUB _DoSomethingWithIt
IF E=2 GOSUB _DoSomethingWithIt
UNTIL E=-1

_DoSomethingWithIt:
A=SELECTEDCHOICE
RETURN

This is not good, A could get the selected item of any the 2 LISTCHOICEs. And we have no way to know which one.

Maybe give a look to the iBAddress sample program shipped with iziBasic. It does handle a LISTCHOICE to sort the different records.

Cheers,

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
14/12/2004 @ 23:44
by Mike Featherstone

Anonymous

visitor
That covers it - I hadn't completely understood the use of SelectedChoice and had expected it to return a value based on the default selection.

Now I understand!

Thanks,
Mike
Write to Mike Featherstone   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
15/12/2004 @ 04:11
by Chuck

Anonymous

visitor
I may be mis-using the LISTCHOICE command, but I have used the initial value to display "Options" as a simulated menu choice at the top of the screen. I then show three other choices when selected and reset the initial value back to "Options" when done.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4
--------
15/12/2004 @ 20:23
by aldweb

Anonymous

visitor
Mike, I am happy that I answered your request.

Chuck, this is not a mis-use, it is another use which is very common too

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5
--------
16/12/2004 @ 11:13
by Khertan

Anonymous

visitor
For your informations, i do the same use of listchoice :)
Write to Khertan   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^