Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Open" Problem
#11
As one final suggestion, just after your line:

INPUT #1, qb, kicker, seasons, TOTALWON, TOTALLOST, WON, LOST, NAME$, TRAIN

add this one:

PRINT "qb =";qb;", kicker =";kicker;", seasons =";seasons";", TOTALWON =";TOTALWON;", LOST =";LOST;", NAME$ = ";NAME$;", TRAIN=";TRAIN

Now, you can see where your problem begins, so you can do whatever correction your probgram requires! Good luck.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#12
Thanks, I'll give it a try when I get a chance.
Not yet Snake! It's not over yet!
Reply
#13
Changing the variable "name$" didn't make any difference.
The loop doesn't seem to be the problem either.
Not yet Snake! It's not over yet!
Reply
#14
Quote:As one final suggestion, just after your line:

INPUT #1, qb, kicker, seasons, TOTALWON, TOTALLOST, WON, LOST, NAME$, TRAIN

add this one:

PRINT "qb =";qb;", kicker =";kicker;", seasons =";seasons";", TOTALWON =";TOTALWON;", LOST =";LOST;", NAME$ = ";NAME$;", TRAIN=";TRAIN

Now, you can see where your problem begins, so you can do whatever correction your probgram requires! Good luck.


I can't right after that line because the problem comes up ON THAT LINE, so it doesn't go past it.
Not yet Snake! It's not over yet!
Reply
#15
Quote:[syntax="qbasic"]What may be happening is you might have a file that looks like this:

Code:
50 50 0 0 0 0 0 name 0

With an extra blank line at the end of the file. If there is one, delete it.

If that doesn't work, try adding commas so your file looks like this:

Code:
50,50,0,0,0,0,0,"name",0

You'll still get the same result, but it should be easier to work with.

Good luck!

--j_k

How do you input commas into the file?
Not yet Snake! It's not over yet!
Reply
#16
Quote:I think It's the loop.

try:
DO
IF EOF(1) = -1 THEN EXIT DO
INPUT #1, blah blah blah
LOOP

That will work as long as the txt file is correct which you said ot was.

Unfortuanately, that wasn't the case either
Not yet Snake! It's not over yet!
Reply
#17
Quote:
Ralph Wrote:As one final suggestion, just after your line:

INPUT #1, qb, kicker, seasons, TOTALWON, TOTALLOST, WON, LOST, NAME$, TRAIN

add this one:

PRINT "qb =";qb;", kicker =";kicker;", seasons =";seasons";", TOTALWON =";TOTALWON;", LOST =";LOST;", NAME$ = ";NAME$;", TRAIN=";TRAIN

Now, you can see where your problem begins, so you can do whatever correction your probgram requires! Good luck.


I can't right after that line because the problem comes up ON THAT LINE, so it doesn't go past it.

O.K., then, try dissecting your INPUT and PRINT statements:

INPUT #1, qbTongueRINT "qb =";qb
INPUT#1, kickerTongueRINT "kicker =";kicker
etc.

Now, you should be able to see at what point the INPUT has a problem.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#18
ok I'll give it a try, but I'm open to any other suggestions as well.
Would I still need the loop if I try what you suggested?

By the way, is the OPEN statement the easiest way to do this? Or is there a better way?
Not yet Snake! It's not over yet!
Reply
#19
Quote:ok I'll give it a try, but I'm open to any other suggestions as well.
Would I still need the loop if I try what you suggested?

By the way, is the OPEN statement the easiest way to do this? Or is there a better way?
Yes, you will maintain all your code just as it is, except for modifying the INPUT #1 statement to only one entry at a time, followed by the addition of a PRINT statement with the expected entry, so you can see at which point the problem begins. Me, I am only trying to help you find the problem you have.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#20
Quote:
Liquid Snake Wrote:ok I'll give it a try, but I'm open to any other suggestions as well.
Would I still need the loop if I try what you suggested?

By the way, is the OPEN statement the easiest way to do this? Or is there a better way?
Yes, you will maintain all your code just as it is, except for modifying the INPUT #1 statement to only one entry at a time, followed by the addition of a PRINT statement with the expected entry, so you can see at which point the problem begins. Me, I am only trying to help you find the problem you have.

The problem occurs at the last variable.
Not yet Snake! It's not over yet!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)