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!

Moderators: Pete, Mods

User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN
Contact:

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

Postby Stoves » Fri Feb 10, 2006 12:32 am

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

Return to “QBASIC and QB64 Questions & Answers”

Who is online

Users browsing this forum: No registered users and 4 guests

cron