DIM statement issues[solved]

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

azure8bit
Newbie
Posts: 4
Joined: Tue Oct 11, 2016 11:28 pm

DIM statement issues[solved]

Postby azure8bit » Thu Nov 10, 2016 4:19 am

Im having trouble getting my data list to print using the DIM statement. If someone could assist me or point me in the right direction. It would be appreciated.

Code: Select all


DIM Number(15), Income(15), Persons(15)
'**************************** PROGRAM MAINLINE ******************************
GOSUB InitializerPrintImages
gosub printheadings
gosub processdetail
end
'************************* INITIALIZE PRINT IMAGES **************************
InitializerPrintImages:
TITLE1$ = "ID Number      Annual Income      Number of Persons"
a1$ = "####               ######         ##               "
return
'*************************PRINT HEADINGS********************************
PrintHeadings:
print title1$
return
'******************Process Detail*********************
processdetail:

gosub loadtable
do until Number = END
    gosub displaytable
    gosub loadtable
loop
return
   
'*****************************load table*************************************8
loadtable:
for s = 1 to 14
    READ Number(s),Income(s),Persons(s)
next s
data 2497,12500,2
data 3323,13000,5
data 4521,18210,4
data 6789,8000,2
data 5476,6000,1
data 4423,16400,3
data 6587,25000,4
data 3221,10500,4
data 5555,15000,2
data 0085,19700,3
data 3097,20000,8
data 4480,23400,5
data 0265,19700,2
data 8901,13000,3
data end, end, end
return


'*********************DISPLAYTABLE**************************************
displaytable:
print using a1$;Number(s),Income(s),Persons(s)
return



Return to “QBASIC and QB64 Questions & Answers”

Who is online

Users browsing this forum: Google [Bot] and 4 guests