• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

GWBasic help

I have a very small gwbasic program that is converting some data for our payroll system. I know gwbasic is super old and we are planning on updating to a more modern language, but I cant do that yet and the process is failing at the moment.

Here is my code:

1400 LPRINT CHR$(12);
1430 CLOSE:OPEN "I",#1,"C:\UTILITY\PAYROLL\EXC
1431 LPRINT:LPRINT:LCNT=2
1432 LINE INPUT #1,IN1$:LPRINT TAB(10);IN1$:LC
1433 IF LCNT>=57 THEN GOTO 1500
1434 IF EOF(1) THEN 1500
1435 GOTO 1432
1450 FOR X=1 TO 3
1451 SOUND 500,5:SOUND 1500,5:SOUND 2500,5:SOU
1452 SOUND 4500,5:SOUND 3500,5:SOUND 2500,5:SO
1453 NEXT X
1460 SYSTEM
1500 IF LCNT=58 THEN 1510 ELSE LPRINT:LCNT=LCN
1510 PAGE=PAGE+1
1511 LPRINT TAB(30);"PAGE ";PAGE:LPRINT CHR$(1
1512 IF EOF(1) THEN 1450
1520 LPRINT:LPRINT:LPRINT TAB(10);"THIS INFORM
NT
1530 LCNT=4
1540 LINE INPUT #1,IN1$
1550 IF LEN(IN1$)<10 THEN 1432 ELSE 1555
1555 LPRINT TAB(10);IN1$:LCNT=LCNT+1:GOTO 1433

I dont know anything about gwbasic as this was created by a former employee who is no longer here.

I am getting the error: "Input path end in 1432"

Now looking at line 1432 it is trying to print. I dont know what the commands are doing. Can someone put these commands into english so I can understand exactly what the process is doing? I know this is ancient coding and I hope we can find an "old school" programmer that may be able to help.

Thanks.
0
adembo
Asked:
adembo
  • 2
  • 2
1 Solution
 
jkrCommented:
The lines are incomplete, they're cut off at the end. Could you provide the full source?
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
That line has at least three parts (as jkr pointed out the lines are cut off so there could be more):

    1432 LINE INPUT #1,IN1$:LPRINT TAB(10);IN1$:LC

The colon ":" allows you to have more than one command per line.

The first part is:

    LINE INPUT #1,IN1$

Which reads a line from the file pointed to by handle #1 and places it into the variable called "IN1" (which is a string variable because it has $ on the end).

Back in line 1430, a file was opened with #1 using the "Open" statement.

I believe the error means the file pointer is at the end of the file and it can't read the next line because there is no more to be read.  So either the file is empty, is missing data (or is corrupt), or there are more LINE INPUT statements above that line (that were cutoff so we can't see them) that have read too many lines (a logic error?).
0
 
ademboAuthor Commented:
Thanks. I ran the program again this week and it worked just fine. The program basically just created a text file from another data source that our payroll system then could import. It probably just couldnt find the data or file like Idle_Mind suggested.

I dont know how to get the rest of the code, as I am in a DOS window and I hightlighted everything and chose copy, the result was what you see above.

That is OK though, I basically just wanted to know what the commands were doing, and you have gave me some insight to that.

Thanks.
0
 
jkrCommented:
Thanks for getting back so quickly and posting your code *grmpf*
0
 
ademboAuthor Commented:
jkr,

Sorry. I mentioned in the last post that I couldnt figure out how to post the rest of the code.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now