Anyone know why I am getting errors compiling my chess program with QB64?

by qbguy (no login)

http://www.network54.com/Forum/190883/message/1205452584/Chess+Program+for+QB64

The QB64 QB-to-C translator did not support CALL, nor did it support this version of IF/ELSE-IF/etc:

IF PIECE = 100 THEN
CALL PAWN(A, B, XX(), YY(), NDX)
ELSEIF PIECE = 270 THEN CALL KNIGHT(A, B, XX(), YY(), NDX)
ELSEIF PIECE = 300 THEN CALL BISHOP(A, B, XX(), YY(), NDX)
ELSEIF PIECE = 500 THEN CALL ROOK(A, B, XX(), YY(), NDX)
ELSEIF PIECE = 900 THEN CALL QUEEN(A, B, XX(), YY(), NDX)
ELSE CALL KING(A, B, XX(), YY(), NDX)
END IF

I had to change it to

 IF PIECE = 100 THEN
  PAWN A, B, XX(), YY(), NDX
 ELSEIF PIECE = 270 THEN
  KNIGHT A, B, XX(), YY(), NDX
 ELSEIF PIECE = 300 THEN
  BISHOP A, B, XX(), YY(), NDX
 ELSEIF PIECE = 500 THEN
  ROOK A, B, XX(), YY(), NDX
 ELSEIF PIECE = 900 THEN
  QUEEN A, B, XX(), YY(), NDX
 ELSE
  KING A, B, XX(), YY(), NDX
 END IF

After making these modifications, the program sucessfully passed through the QB-to-C translator. However, it produced errors when compiling the C code. How did these errors come about?

Posted on Mar 13, 2008, 5:00 PM
from IP address 75.9.218.72

Respond to this message   

Return to Index


Response TitleAuthor and Date
Probably another thing where there is more than one way to code...Pete on Mar 13
RE: Using GOSUB inside a SUB on Mar 13
 Fixed the above problem (+screenshot) on Mar 14
  * Great job, Galleon! It sounds like your progress on QB64 is moving very smoothly! ^_^rpgfan3233 on Mar 15
  Cool.Dav on Mar 15
   * In addition, QB is somewhat known on the comp.lang.basic.misc Usenet group. (URL)rpgfan3233 on Mar 15