|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1304 |
Question about POPUPCHOICE |
le 29/11/2005 @ 21:46 par Michael Green
|
The following is a fragment from a program. I get a syntax error in the POPUPCHOICE statement and I don't understand why. A$(27)="Daily" A$(28)="2x Per Day" A$(29)="3x Per Day" A$(30)="" POPUPCHOICE #102,1,A$(27),3,118,100,40,30 As an extension to isiBasic, I'd suggest a simple choice list without the popup. Sometimes it's more useful to show the choices on the display all the time even though it takes up screen real estate.
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 30/11/2005 @ 19:30 par aldweb
visiteur |
Hello Michael,
The correct syntax is this one:
POPUPCHOICE #102,1,"A$ (27)",3,118,100,40,30
Cheers, aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 23/04/2008 @ 08:27 par Lee Mulcahy
visiteur |
I had this same question. When I tried your answer, it did not work. All it displayed was the string "A$(27)", not the contents of A$(27).
I am using v6.0 of iziBasic.
Thanks,
Lee
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 26/04/2008 @ 00:17 par Nate Weil
visiteur |
Michael you mean adding a list instead of a popup menu-like list? I really want that too... I've made an app launcher of sorts, but I really really really could use a list or table to do it... also why can't izibasic run palm-made apps? Only 3rd party stuff shows up... |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 26/04/2008 @ 23:36 par aldweb
visiteur |
Hello,
I just tried the following code, and it does work:
DIM A$(30) BEGIN A$(27)="Daily" A$(28)="2x Per Day" A$(29)="3x Per Day" A$(30)="" POPUPCHOICE #102,1,"A$(27)",3,118,100,40,30 REPEAT E=WAITEVENT UNTIL E=-1 END
Nate, I don't get your point when you say "also why can't izibasic run palm-made apps? Only 3rd party stuff shows up...". Do you mean that some applications cannot be launched with the RUN statement?
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5 -------- le 27/04/2008 @ 05:53 par Lee Mulcahy
visiteur |
Hi,
It turns out that I was trying to initialize the A$() elements BEFORE the BEGIN statement. When I moved them inside, it worked. However, when the App is first started, the dropdown list shows 'A$(27)' until it is clicked on the first time. This happened with your example also. What am I doing wrong?
Thanks,
Lee
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 6 -------- le 27/04/2008 @ 18:15 par nate Weil
visiteur |
so I go through all the apps on my palm and put them in a list so I can see them all. Apps made by me show up, apps made by others show up, anything that did not come with the palm. Media player does not show up, calendar, notes, contacts, etc.. They can not be run/found. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 7 -------- le 30/04/2008 @ 18:18 par aldweb
visiteur |
Lee,
Try this code instead:
DIM A$(30) BEGIN A$(27)="Daily" A$(28)="2x Per Day" A$(29)="3x Per Day" A$(30)="" POPUPCHOICE #102,"Daily","A$(27)",3,118,100,40,30 REPEAT E=WAITEVENT UNTIL E=-1 END
Cheers, aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 8 -------- le 30/04/2008 @ 18:22 par aldweb
visiteur |
Hello Nate,
Running the following code works like a charm in all my devices, returning all applications, either in ROM or in RAM.
' Listing generated by ViziBasic v2.2 ' 30/04/2008 @ 18:15:19
{CREATORID "LDTE"} {VERSION "1.0"} {MINOSVERSION "5.0"} {PARSER ON} '{KEYEVENTS OFF} '{SECUREFILES ON} '{CONSOLEFONT ON}
DIM %EVT%,%P1%,%P2%,%P3% DIM %P1$,%P2$,%P3$
DIM A$(500)
BEGIN GOSUB _OnAppStart GOSUB _GenerateGUI GOSUB _EventsLoop GOSUB _OnAppExit END
_GenerateGUI: %P2$="A$(30)" '%P1$="¶" : %P3%=1 : %P2%=LEN(%P2$) 'FOR %P1%=1 TO %P2% ' %P3$=CHAR$(%P2$,%P1%) ' IF %P3$=%P1$ INC %P3% 'NEXT %P3%=10 %P1$="Select Application" SETFONT 0 POPUPCHOICE #1,%P1$,%P2$,%P3%,10,20,100,12 %P1$="Run" SETFONT 0 BUTTON #2,%P1$,60,140,40,14 RETURN
_EventsLoop: REPEAT %EVT%=WAITEVENT SELECT CASE %EVT% CASE 1 GOSUB _POPUPCHOICE_1 CASE 2 GOSUB _BUTTON_2 END SELECT UNTIL %EVT%=-1 RETURN
_POPUPCHOICE_1: S=SELECTEDCHOICE+29 RETURN
_BUTTON_2: A=(S>30) AND (S<=I) IF A=TRUE THEN A$=A$(S) RUN A$ ENDIF RETURN
_OnAppStart: A$(30)="Select Application" I=30 A$=FINDFIRST$("appl","") WHILE A$<>"" INC I : A$(I)=A$ A$=FINDNEXT$ '("appl","") WEND SORT A$,31,I RETURN
_OnAppExit:
RETURN
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 9 -------- le 30/04/2008 @ 18:49 par nate Weil
visiteur |
I believe you mentioned before your devices are older... I have a tungsten E2 maybe the device has to do with it, what with updates and all that. I always get the same results though... |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 10 -------- le 30/04/2008 @ 19:01 par aldweb
visiteur |
I tested this code in a Tungsten C and a TX. I did not take the time to test it in my Tréo 680, but I see no reason why it would work in the TX and not the Tréo.
Cheers, aldweb
|
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|