Qbasicnews.com

Full Version: please help me with pixel plus 256
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
please help me with putting a pixel plus file into a qbasic file:
can some one please edit this code so it works
i found it on a post...

'start
DEFINT A-Z
SUB HARloadPut (FileName$, Array() AS INTEGER)
l& = 0
FF= FREEFILE
OPEN FileName$ FOR BINARY AS #FF
l& = LOF(FF)
CLOSE #FF
Ints = (l& - 7) \ 2
$DYNAMIC
REDIM Array(Ints) AS INTEGER
DEF SEG = VARSEG(Array(0))
BLOAD FileName$, 0
DEF SEG
END SUB

SCREEN 13
DIM MyArray(0) AS INTEGER
HARloadPut "c:\pp256\images\hero.PUT", MyArray()
PUT (0,0), MyArray, PSET
'end



thanks in advance Big Grin
Add a comment character before the $DYNAMIC metacommand. This should work:
Code:
'start
DEFINT A-Z
SUB HARloadPut (FileName$, Array() AS INTEGER)
l& = 0
FF= FREEFILE
OPEN FileName$ FOR BINARY AS #FF
l& = LOF(FF)
CLOSE #FF
Ints = (l& - 7) \ 2
'$DYNAMIC
REDIM Array(Ints) AS INTEGER
DEF SEG = VARSEG(Array(0))
BLOAD FileName$, 0
DEF SEG
END SUB

SCREEN 13
'$DYNAMIC
DIM MyArray(0) AS INTEGER
HARloadPut "c:\pp256\images\hero.PUT", MyArray()
PUT (0,0), MyArray, PSET
'end
Big Grin it works thank you so much Big Grin