Solved

GWBasic help

Posted on 2006-11-22
5
733 Views
Last Modified: 2013-12-03
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
Comment
Question by:adembo
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 17997543
The lines are incomplete, they're cut off at the end. Could you provide the full source?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18055345
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
 
LVL 2

Author Comment

by:adembo
ID: 18056375
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
 
LVL 86

Expert Comment

by:jkr
ID: 18056392
Thanks for getting back so quickly and posting your code *grmpf*
0
 
LVL 2

Author Comment

by:adembo
ID: 18056642
jkr,

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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now