aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1014

Forum - Forum
iziBasic - iziBasic


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

actif  Sujet n° 1014  Use of ListChoice

le 14/12/2004 @ 13:22
par Mike Featherstone

Anonyme



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?
Ecrire à Mike Featherstone   Poster une réponse  Haut

[]   


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

Anonyme

visiteur
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
Ecrire à aldweb   Poster une réponse  Haut

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

Anonyme

visiteur
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
Ecrire à Mike Featherstone   Poster une réponse  Haut

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

Anonyme

visiteur
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.
  Poster une réponse  Haut

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

Anonyme

visiteur
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
Ecrire à aldweb   Poster une réponse  Haut

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

Anonyme

visiteur
For your informations, i do the same use of listchoice :)
Ecrire à Khertan   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^