|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1087 |
Strange results with messagebox and POSE |
06/02/2005 @ 19:40 by Larry
|
The below, when the message box appears, shows the last filename twice after the messagebox text? Is there is a chr$(0) or something I need to add?
'mr01.ibas {creator id "mr01"} dim a$(100) begin c=1 e=0 a$(c)=findfirst$("","") c=c+1 l=9 while l>1 b$=findnext$("","") l=len(b$) if l>1 then a$(c)=b$ print b$ c=c+1 end if wend e=messagebox("Thanks for using files...",0) end
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 11/02/2005 @ 15:44 by aldweb
visitor |
Hello Larry,
At this stage, but I will need to test your program, I see two possibilities:
1. Either there is a bug in the console, that displays the last line twice because it does not correctly do the last line feed. Try to add this between your wend and e=messagebox() lines: c$=chr$(10) print c$
2. Or the last filename should really be displayed twice. Indeed you use findfirst and findnext with blank parameters. Then, some files may exist twice in your system (like the empty skeletton of standard applications databases in ROM and the really used file in RAM) and it is normal that they are reported twice.
Cheers
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 12/02/2005 @ 14:48 by Larry
visitor |
The two filesnames show up in the message box, not on the console screen. At the end of my actual message box message.
I also sent another program to you (EMAIL) that hangs the emulator.
Thanks |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 12/02/2005 @ 15:39 by aldweb
visitor |
Larry,
I tried your piece of code and I indeed get the same error. So, you are right. I can already guess where the bug lies. I will investigate.
As for the other program you sent me, I am going to give a look to it right now.
Cheers
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 15/02/2005 @ 23:35 by aldweb
visitor |
Larry,
I studied with a little bit more attention your source code and there is no iziBasic bug, but I could find 2 little mistakes in your source code
You dim a$(100), so reserving 100 minus 26 spaces for a$().
1st mistake: Then, you initialize c=1, and increment it each time after you put a new value in a$(c). => a$(1) to a$(27) are also a$ to z$ (see iziBasic's user manual, arrays chapter). => as you use b$ afterwards in your source code, the a$(2) cell which should hold the filename of the 2nd file found will always be wrong.
2nd mistake: As c increases, at one point it will get over 100 because there are more than 100 files in a common device, so it starts writing in the memory heap. => And one value will be written in the text heap that is needed by the MESSAGEBOX function. => This is why you get this unexpected display result in your MESSAGEBOX.
Cheers
@+ aldweb |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|