Here's the answer. What's the question?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
Post Reply
User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN

Here's the answer. What's the question?

Post by Stoves »

DECLARE FUNCTION readInt! (file%, offset%)
'Coded by drnull

OPEN "..\qbpics\a1.sqr" FOR BINARY AS #1

SCREEN 13
CLS

DIM picH, picW AS INTEGER
DIM bpp AS INTEGER

bpp = 8

picW = readInt(1, 8 ) / bpp
picH = readInt(1, 10)

PRINT "Width is" + STR$(picW)
PRINT "Height is" + STR$(picH)

FUNCTION readInt (file%, offset%)

DIM a$
a$ = " "

GET file%, offset%, a$
value = ASC(a$)
GET file%, , a$
value = value OR (ASC(a$) * 256)

readInt = value

END FUNCTION
Post Reply