Afternoon all,
Cant believe i am asking this but how do you use *LOAD
I have tried a few combinations of variables/addresses but can not get the bmp file to load into memory!!!!
t$="Round the rugged rock the ragged rascal ran"
f%=OPENOUT("tempsentence.txt")
PRINT#f%,t$
CLOSE#f%
DIM text 5000
OSCLI "LOAD tempsentence.txt " + STR$~(text)
FOR x%= 0 TO LEN(t$)-1
PRINT CHR$(text!x%);
NEXT x%
PRINT
Note the space after the file name, to separate the data block address as a separate parameter (Looks like you need spaces rather than commas between the parameters: changing this alone might rescue your code?).
All i am trying to do is load a bmp in to memory and display it using *MDISPLAY, i thought would be a simple exercise, but it appears not. I still get address out of range!!
In the manual under *MDISPLAY it says you can load an image using *LOAD. I have tried many ways to get a simple program to work and failed.
REM For this example, the BMP image must reside in the same
REM folder from which this program is run.
file$ = @dir$ + "ball0.bmp"
F% = OPENIN( file$ )
IF F% = 0 ERROR 0, "Can't load " + file$
S% = EXT#F%
CLOSE#F%
DIM bmpdata% S%
OSCLI "LOAD """ + file$ + " """ + STR$~bmpdata%
OSCLI "MDISPLAY "+STR$~bmpdata%
Copy & paste into (for example) the BB4W IDE, then save the program somewhere. Make sure the BMP file is in the same folder as where the program is saved. Obviously, modify the BMP file name (file$) accordingly.
OSCLI("SCREENSAVE "+@dir$+"Temp.bmp "+STR$l%+","+STR$t%+","+STR$w%+","+STR$h%)
bf%=OPENIN(@dir$+"temp.bmp"):bmp$=GET$#bf% BY EXT#bf%:CLOSE#bf%
SYS"SetStretchBltMode",@memhdc%,3
OSCLI("MDISPLAY "+STR$~PTR(bmp$)+" "+STR$l%+","+STR$t%+","+STR$w%+","+STR$h%)
(The first and second lines may be my addition for my purposes.)
The only problem I find is that it only works once with a large screensave and the next time crashes with a "No room" error. If anyone has any bright ideas on what I am doing wrong, I'll be pleased to hear them - I suspect it revolves around getting rid of bmp$ at the end of the routine, but I don't know how to do that.