Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,337 members, 7,780,887 topics. Date: Friday, 29 March 2024 at 02:44 AM

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

Nairaland Forum / Science/Technology / Programming / Need A Little Help On A Qbasic Code (884 Views)

I'm Having A Problem With This Qbasic. Who Can Help? / Can A Vast Qbasic Programmer Do This? / Learn Qbasic Programming Language In 14 Days (2) (3) (4)

(1) (Reply)

Need A Little Help On A Qbasic Code by Capnd143(m): 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(m): 5:35pm On Jul 18, 2016
no help? come on!!!!!!!!!!!!!!!

(1) (Reply)

Online Booking Engine For Travel Agents / Http://palshub.yooco.com New Invention / Empowertech Live At Egbeda

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.