Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming 101 project

Name: Anonymous 2007-12-04 1:30

101, yeah, I know, I'm new at this.

The class is on QBASIC, and I'm trying to figure out why

WHILE INSTR(Move$, " ") > -1
   A = INSTR(Move$, " ")
   C = A + 1
   B = A - 1
   D = LEN(Move$)
   LeftPart$ = LEFT$(Move$, (B))
   RightPart$ = MID$(Move$, (B), (D - B))
   Move$ = LeftPart$ + Right$
WEND

returns "ILLEGAL FUNCTION CALL" at the LeftPart$ line.

Name: Anonymous 2007-12-04 14:47

>>1
Holy shit, I haven't programmed QBASIC for over 12 years. I'm amazed that it's still being used for teaching.

"Illegal function call" means that you called the LEFT$ function with a bad parameter. Probably your variable B has become negative at some point.

You should add some debugging info just before it, something like PRINT A, B, C, D, Move$. Then look at your output screen to see what your program actually did.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List