Re: my bitmap problem again
- Posted by Robert Craig <rds at RapidEuphoria.com> May 16, 2004
- 395 views
John McAdam wrote: > It's me again. I have cut down all the non relevant code to the part > that gives me a problem. > Here is the code, which should be copied into a subdirectory. The code > (on my machine) runs > once ok, but with an erroneous error message at the return to the > editor; or sometimes after > the second run. Please see if this happens to you, or is peculiar to my > machine. You can use > any small 256 color bitmap file that you may have and it will do the > same thing. The code > looks fine to me, so I think the error is in the interpreter. The > included files are standard, > so no need to send them. Could be in the editor? I'm using The CyrekSoft > EE Editor v2.2:CS1. > JOHN > ------------------------------------------------------------------------ > ------------- > include graphics.e > include image.e > include get.e > include file.e > > object key --usually user key stroke, sometimes junk > > procedure intro_window() > sequence ss > if graphics_mode(259) then end if > ss=read_bitmap("a.bmp") > printf(1,"size of ss %d ",length(ss)) > key=wait_key() > all_palette(ss[1]/4) > display_image({0,0},ss[2]) > key=wait_key() > key=chdir("..") --something very strange happens here > end procedure > > intro_window() I don't know exactly what's wrong, but a few things worry me: 1. You declare ss as a sequence, but if read_bitmap() fails it will return an atom, such as 1 (open failed). That will give you a type_check error. 2. If this type_check error occurs, you will be in SVGA mode 259, so I'm not sure if you'll see the error on your screen. 3. You have a chdir() call in your program, so after running once, I'm not sure that a.bmp will still be in the current directory. I'm also not sure where ex.err will be written. 4. SVGA modes are not well supported in DOS. I can imagine that there might be trouble if you switch into SVGA from a DOS editor system() call. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com