₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,134 members, 8,420,511 topics. Date: Thursday, 04 June 2026 at 10:52 PM

Toggle theme

Need A Little Help On A Qbasic Code - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed A Little Help On A Qbasic Code (964 Views)

1 Reply

Need A Little Help On A Qbasic Code by Capnd143(op): 4:44pm On Jul 18, 2016
ok.. i have this qbasic assignment were i am supposed to open a random & record file, store the salaries of four employees and the read and print the content of the file... but after running the program, i keep getting and additional empty record at the end of the file... how do iget rid of it; this is my code;

CLS
REM " AN EXERCISE ON RANDOM FILES "
REM "PROGRAM WRITTEN BY AKPAN, TIMOTHY MAXWELL. A CSC101 STUDENT"

TYPE employeeType
ename AS STRING * 10
BS AS INTEGER
HA AS INTEGER
AA AS INTEGER
END TYPE

DIM employee AS employeeType
phase:
PRINT " [1] create a new recordset"
PRINT " [2] view existing recordset"
INPUT "please type either [1] or [2]....", value%

IF value% = 1 THEN
OPEN "dats1.txt" FOR RANDOM AS #1 LEN = LEN(employee)
INPUT "How many records do you want to create", recnum%
FOR i = 1 TO recnum%
CLS
INPUT "Employee Name:", employee.ename
INPUT "Basic salary:", employee.BS
INPUT "Hazard Alowance:", employee.HA
INPUT "A.Allowance:", employee.AA
IF i = recnum% THEN EXIT FOR

PUT #1, , employee
NEXT i

CLS
CLOSE #1
value% = 2

END IF

IF value% = 2 THEN
PRINT "name", " basic salary ", " hazard allowance", "a.llowance"
OPEN "dats1.txt" FOR RANDOM AS #1 LEN = LEN(employee)
DO WHILE NOT EOF(1)
GET #1, , employee
PRINT employee.ename, employee.BS, employee.HA, employee.AA
LOOP
CLOSE #1
GOTO phase
END
END IF




Re: Need A Little Help On A Qbasic Code by Capnd143(op): 5:35pm On Jul 18, 2016
no help? come on!!!!!!!!!!!!!!!
1 Reply

I'm Having A Problem With This Qbasic. Who Can Help?Can A Vast Qbasic Programmer Do This?Learn Qbasic Programming Language In 14 Days234

We Don’t Just Build You An E-commerce Site….we Make Your Business Grow GloballyPaying App Just Ready Ur Paypal OthersComplete School Management System