|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1221 |
Newbie |
le 29/06/2005 @ 14:17 par Watts
|
I have never really done any palm programming but I done allot of programming with several different flavors of BASIC. In izibasic how do you get a second window to open(or even invoke one) and add controls to it and be able to close that and return to the first one. I am having trouble opening another program from a program that I have generated. If anybody could direct to some simple code examples or a collect of public domain snippets that I could to my collection of tools other than the ones that came with the full version of izibasic. Also it would be nice if there was a PC based editor that I could use that was izibasic specific. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 11 -------- le 01/07/2005 @ 00:19 par aldweb
visiteur |
Sorry, dear Khertan, earlier tonight my head had not made the link between the fact that you are a Mac/Linux user and that my PsPad stuff would only wrok for Windows users!
So, have "fun" developing your editor
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 12 -------- le 01/07/2005 @ 04:19 par Watts
visiteur |
This still doesn't work on my PDA Palm OS Version 4.1H. I have substituted the string variable A$ or B$ into the message box field in place of the C$. The VAL function always produces a zero. The message box produces the correct string variable. I am beginning to think the VAL function is not working on my PDA. It won't run on my Emulator either. Should I define some type of global parameters prior to performing mathematical functions?
TEXTFIELD #1, "VALUE 1", 5, 5, 50, 10 TEXTFIELD #2, "VALUE 2", 5, 5, 50, 10 A$=FIELD$(#1) B$=FIELD$(#2) A=VAL(A$) B=VAL(B$) C=A/B C$=STR$(C$) MESSAGEBOX (C$,0)
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 13 -------- le 01/07/2005 @ 14:20 par aldweb
visiteur |
Hello Watts,
What you get is expected because your source code is not valid.
#1. Please read the brand new Topic #1222 - GUI basic commands
#2. Your TEXTFIELD #1 and TEXTFIELD #2 are put at the same place on the screen, so TEXTFIELD #1 will not appear (it is drawn under TEXTFIELD #2).
#3. iziBasic is not told if values were given in the 2 text fields, so it currently draws the text fields and just after, without giving the user a chance to key in some data in them, retrieves their value and does the calculation. So, let's add a [Calculate] button and do the calculation only when this button is pressed:
TEXTFIELD #1, "VALUE 1", 5, 5, 50, 10 TEXTFIELD #2, "VALUE 2", 5, 25, 50, 10 BUTTON #3,"calculate",5,45,50,14 REPEAT E=DOEVENTS IF E=3 GOSUB _CalcIt : E=-1 UNTIL E=-1 END _CalcIt:
A$=FIELD$(#1) B$=FIELD$(#2) A=VAL(A$) B=VAL(B$) C=A/B C$=STR$(C$) MESSAGEBOX (C$,0) RETURN
Cheers, aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 14 -------- le 03/07/2005 @ 20:07 par Watts
visiteur |
The code I am using is posted bellow. Look at the button named Fuse (handle #6). When I deprees this button I want it to simple perform the simple mathematical operation C=A+B and display it in the message box. It doesnt work for some reasone. Could someone please look at it and tell me what to change.
'Jason.ibas {CREATORID "jhwx"} {PARSER ON} ABOUTBOX "Built By Jason Watts" TITLE "Box Tools" BUTTON #1,"Drivers",10,20,40,10 BUTTON #2,"Vent",55,20,40,10 BUTTON #3,"Units",100,20,40,10 BUTTON #4,"Core",10,35,40,10 BUTTON #5,"Volume",55,35,40,10 BUTTON #6,"Fuse",100,35,40,10 BUTTON #7,"Wave",10,50,40,10 BUTTON #8,"Ebp",55,50,40,10 BUTTON #9,"Net",100,50,40,10 REPEAT E=DOEVENTS IF E=1 THEN SHOW #2 SHOW #3 SHOW #4 SHOW #5 SHOW #6 SHOW #7 SHOW #8 SHOW #9 ENDIF IF E=2 THEN HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 ENDIF IF E=3 THEN HIDE #1 HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 TITLE "Unit Converter" BUTTON #18,"mm To In",5,50,100,10 TEXTFIELD #19,"Length(Inches)",0,5,30,150,10 ENDIF IF E=4 THEN HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 ENDIF IF E=5 THEN HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 ENDIF
IF E=6 THEN HIDE #1 HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 TITLE "Fuse" BUTTON #10,"Fuse Value(Amps)",5,50,100,10 NUMFIELD #11,"Driver Impedance(Ohms)",0,5,15,150,10 NUMFIELD #12,"Driver Power(Watts)",0,5,30,150,10 ENDIF
IF E=10 THEN A$=FIELD$(#11) B$=FIELD$(#12) A=VAL(A$) B=VAL(B$) C=A+B C$=STR$(C,2) HIDE #10 HIDE #11 HIDE #12 M=MESSAGEBOX(C$,1) TITLE "Box Tools" SHOW #1 SHOW #2 SHOW #3 SHOW #4 SHOW #5 SHOW #6 SHOW #7 SHOW #8 SHOW #9 ENDIF
IF E=7 THEN HIDE #1 HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 TITLE "Wavelength Calculator" BUTTON #16,"Frequency(Hz)",5,50,100,10 TEXTFIELD #17,"Length(Inches)",0,5,30,150,10 ENDIF
IF E=8 THEN HIDE #1 HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 TITLE "Ebp Calculator" BUTTON #13,"EBP Value",5,50,100,10 TEXTFIELD #14,"Driver Fs(Hz)",0,5,15,150,10 TEXTFIELD #15,"Driver Qes",0,5,30,150,10 ENDIF
IF E=9 THEN HIDE #2 HIDE #3 HIDE #4 HIDE #5 HIDE #6 HIDE #7 HIDE #8 HIDE #9 ENDIF
IF E=13 THEN HIDE #13 HIDE #14 HIDE #15 TITLE "Box Tools" SHOW #1 SHOW #2 SHOW #3 SHOW #4 SHOW #5 SHOW #6 SHOW #7 SHOW #8 SHOW #9 A$=FIELD$(#14) B$=FIELD$(#15) ENDIF
IF E=16 THEN HIDE #16 HIDE #17 TITLE "Box Tools" SHOW #1 SHOW #2 SHOW #3 SHOW #4 SHOW #5 SHOW #6 SHOW #7 SHOW #8 SHOW #9 A$=FIELD$(#17) ENDIF
IF E=18 THEN HIDE #18 HIDE #19 TITLE "Box Tools" SHOW #1 SHOW #2 SHOW #3 SHOW #4 SHOW #5 SHOW #6 SHOW #7 SHOW #8 SHOW #9 A$=FIELD$(#19) M=MESSAGEBOX(A$,0) ENDIF
UNTIL E=-1 M=MESSAGEBOX("OK, bye bye then!",0) END |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 15 -------- le 05/07/2005 @ 14:27 par aldweb
visiteur |
Hello,
In the following lines:
NUMFIELD #11,"Driver Impedance(Ohms)",0,5,15,150,10 NUMFIELD #12,"Driver Power(Watts)",0,5,30,150,10 you assign the following initial values for the 2 fields: "Driver Impedance(Ohms)" and "Driver Power(Watts)" This is where the mistake is, you want these to be 2 LABELs to be placed in front of the value to input in the FIELD. Then, whatever you key in, for instance: "10", the value stored will be: "Driver Impedance(Ohms)10". When, doing the VAL() conversion, 0 (zero) will be returned as the first character is not a valid digit.
Cheers,
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 16 -------- le 05/07/2005 @ 16:36 par Watts
visiteur |
I have made the changes and it only produces values of the initial values not the values I have placed into the number fields during the program operation. Could you show me exactly what to do. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 17 -------- le 05/07/2005 @ 19:08 par Watts
visiteur |
I figured it out. |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 18 -------- le 05/07/2005 @ 19:13 par aldweb
visiteur |
Good news. To make sure, here is what I did during my tests. I replaced:
NUMFIELD #11,"Driver Impedance(Ohms)",0,5,15,150,10 NUMFIELD #12,"Driver Power(Watts)",0,5,30,150,10 with:
NUMFIELD #11,"",0,5,15,150,10 NUMFIELD #12,"",0,5,30,150,10
Yeah, that's all folks
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 19 -------- le 04/09/2005 @ 05:21 par Shawn
visiteur |
not answer but a question. I'm trying to learn this izibasic.
using the code sample above, why do i get a syntax error on the following line?
C$=STR$(C$)
my logic says it should be
C$=STR$(C)
but this doesn't pass either.
any ideas?
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 20 -------- le 04/09/2005 @ 16:53 par aldweb
visiteur |
Sure, read the user manual about the STR$() function. You will see that there are 2 parameters for the iziBasic STR$() function.
So, for instance, doing C$=STR$(C,-1) will work great
Cheers
@+ aldweb |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|