BosnianGamingForum
 
Početna stranicaCalendarFAQPretraľnikČlanstvoKorisničke grupeRegistracijaLogin

Share | 
 

 Igra u QBASIC-u

Prethodna tema Sljedeća tema Go down 
Autor/icaPoruka
Don Arman



Broj postova : 4
Join date : 27.11.2009

PostajNaslov: Igra u QBASIC-u   pet lis 29, 2010 6:45 pm

CLS
TYPE employee Type
firstname AS STRING * 30
lastname AS STRING * 30
age AS INTEGER
wage AS SINGLE
END TYPE
DIM employee AS employeeType
PRINT "1.) Create new recordset"
PRINT "2.) View existing recordset"
INPUT "Which option? ", selection% '
IF selection% = 1 THEN
INPUT "How many employees are in the company? ", numRecords%
recordLen# = LEN(employee)
OPEN "database.dat" FOR RANDOM AS #1 LEN = recordLen#
FOR i% = 1 TO numRecords%
CLS<
INPUT "First name: ", employee.firstname
INPUT "Last name: ", employee.lastname
INPUT "Age: ", employee.age
INPUT "Wage: ", employee.wage
PUT #1, ,employee
NEXT i%
CLS
CLOSE #1
PRINT "Recordset creation complete"
END
END IF
IF selection% = 2 THEN
recordLen# = LEN(employee)
OPEN "database.dat" FOR RANDOM AS #1 LEN = recordLen#
format$ = "\ \,\ \ ### $$##.##"
PRINT "Last name First name Age Wage "
PRINT "------------------ ------------------ --- -------"
DO WHILE NOT EOF(1)
GET #1, ,employee 'Sorry about the length of this line!!!
PRINT USING format$; employee.lastname; employee.firstname;
employee.age; employee.wage
LOOP
CLOSE #1
END
END IF
[Vrh] Go down
Korisnički profil
 
Igra u QBASIC-u
Prethodna tema Sljedeća tema [Vrh] 
Stranica 1 / 1.

Permissions in this forum:Ne moľeą odgovarati na postove.
BosnianGamingForum :: Pitanja Vezana Za Informatiku-
Forum(o)Bir: