Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
qbasic won't read most of .bas file...
#1
Quote:In qbasic it reads:

ELSEIF comm$ = "INPUT" THEN INPUT ;
END IF
ELSEIF comm$ = "OUTPUT" THEN PRINT filesrch%(prog%, varin1$), varin2$



In Wordpad it reads:

ELSEIF comm$ = "INPUT" THEN INPUT filesrch%(prog%, varin1$), var$(searchvar%(varin2$, prog%), prog%)
ELSEIF varin2$ = "=" THEN
IF varin4$ = "+" THEN
IF STR$(VAL(varin3$)) = varin3$ AND STR$(VAL(varin5$)) = varin5$ THEN
var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin3$) + VAL(varin5$))
ELSE
var$(searchvar%(varin1$, prog%), prog%) = varin3$ + varin5$
END IF
ELSEIF varin4$ = "-" THEN var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin3$) - VAL(varin5$))
ELSEIF varin4$ = "*" THEN var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin3$) * VAL(varin5$))
ELSEIF varin4$ = "/" THEN var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin3$) / VAL(varin5$))
ELSEIF varin4$ = "/-" THEN var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin5$) ^ (1 / VAL(varin3$)))
ELSEIF varin4$ = "^" THEN var$(searchvar%(varin1$, prog%), prog%) = STR$(VAL(varin3$) ^ VAL(varin5$))
ELSE
var$(searchvar%(varin1$, prog%), prog%) = varin3$
END IF
ELSEIF comm$ = "OUTPUT" THEN PRINT filesrch%(prog%, varin1$), varin2$


All of the rest of that code is supposed to be there, and the program won't work without it. It also gives me a variable required error because of it. Why does it do this and how do I fix it?

qbasicking originally wrote this on tek-tips, and i have no idea as to why this happens. it's interesting though. WHY won't qbasic read it while notepad will?
Jumping Jahoolipers!
Reply
#2
How big is your bas file. Maybe it's too big for the IDE.
Reply
#3
If you copied it from Inet it probably has the end of line format of unix and QB can't read it. Some browsers convert it automatically, some not.
Try to open it with W9x DOS Edit (it should display ok there) then save it. The saved file should work with qb
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)