hi
have entered the code for the hangman game from dbpro volume 1
but comes up an error on line 98
alreadyused = Pos(lettersguessed$,guess$)
subscript must be integer or dword??
full code is
#CONSTANT screenwidth = 800
#CONSTANT screenheight = 600
#CONSTANT fontname = "Courier New"
#CONSTANT fontsize = 30
#CONSTANT fontcolour = RGB(255,255,255)
GLOBAL word$
GLOBAL guess$
GLOBAL wrongguesses
GLOBAL correctletters
InitialiseGame()
ThinkOfWord()
DrawInitialScreen()
REPEAT
GetGuess()
letterfound = CheckForLetter()
IF letterfound = 1
DrawLetter()
ELSE
AddToHangedMan()
ENDIF
UNTIL WordGuessed() OR HangedManComplete()
GameOver()
WAIT KEY
END
FUNCTION InitialiseGame
SET DISPLAY MODE screenwidth,screenheight,16
SET TEXT FONT fontname
SET TEXT SIZE fontsize
INK fontcolor,0
wrongguesses = 0
correctletters = 0
lettersguessed$=""
RANDOMIZE TIMER()
ENDFUNCTION
FUNCTION ThinkOfWord()
DATA "london", "glasgow", "blackpool"
DATA "edinburgh", "boston", "berlin"
DATA "moscow", "sydney", "wellington"
DATA "washingon", "rome", "amsterdam"
DATA "stockholm", "oslo", "lisbon"
DATA "madrid", "prague", "bonn"
DATA "budapest", "vienna"
num = RND(19)+1
FOR c = 1 TO num
READ word$
NEXT c
ENDFUNCTION
FUNCTION DrawInitialScreen()
SET CURSOR 300,80
PRINT "H A N G M A N"
DrawGallows()
DrawHyphens()
ENDFUNCTION
FUNCTION WordGuess()
IF correctletters = LEN(word$)
EXITFUNCTION 1
ENDIF
ENDFUNCTION 0
FUNCTION HangedManComplete()
IF wrongguesses = 6
EXITFUNCTION 1
ENDIF
ENDFUNCTION 0
FUNCTION GameOver()
SET CURSOR 330,200
PRINT "GAME OVER"
ENDFUNCTION
FUNCTION DrawGallows()
BOX 50,500,150,550
LINE 60,500,60,300
LINE 60,300,150,300
LINE 150,300,150,350
ENDFUNCTION
FUNCTION DrawHyphens()
SET CURSOR 200,500
FOR C = 1 TO LEN(word$)
PRINT "_ ";
NEXT c
ENDFUNCTION
FUNCTION GetGuess()
SET CURSOR 200,500
SET TEXT OPAQUE
PRINT " ";
SET CURSOR 200,500
INPUT "Enter your guess", guess$
guess$ = LOWER$(guess$)
alreadyused = Pos(lettersguessed$,guess$)
WHILE LEN(guess$)<>1 OR guess$<"a" OR guess$ > "z" OR alreadyused <> -1
SET CURSOR 200,500
IF LEN(guess$)<>1 OR guess$<"a" OR
guess$ > "z"
PRINT "single letters only"
ELSE
PRINT "You've already entered that letter"
ENDIF
WAIT 2000
SET CURSOR 200,500
PRINT " ";
SET CURSOR 200,500
INPUT "Enter your guess", guess$
guess$ = LOWER$(guess$)
alreadyused = Pos(lettersguessed$,guess$)
ENDWHILE
lettersguessed$ = lettersguessed$+guess$
SET TEXT TRANSPARENT
ENDFUNCTION
FUNCTION CheckForLetter()
letterfound = 0
FOR c = 1 TO LEN(word$)
IF guess$ = MID$(word$, c)
letterfound = 0
FOR c = 1 TO LEN(word$)
IF guess$ = MID$(word$,c)
letterfound = 1
ENDIF
NEXT c
IF letterfound=0
wrongguesses = wrongguesses + 1
ENDIF
ENDFUNCTION letterfound
FUNCTION DrawLetter()
SET CURSOR 250,400
FOR c = 1 TO LEN(word$)
IF guess$ = MID$(word$,c)
PRINT guess$," ";
correctletters = correctletters+1
ELSE
PRINT" ";
ENDIF
NEXT c
ENDFUNCTION
FUNCTION AddToHangedMan()
SELECT wrongguesses
CASE 1:
CIRCLE 150, 360, 10
ENDCASE
CASE 2
ELLIPSE 150,400,10,30
CASE 3
LINE 145,428,135,460
ENDCASE
CASE 4
LINE 155,428,165,460
ENDCASE
CASE 5
LINE 143,380,133,410
ENDCASE
CASE 6
LINE 157,380,167,410
ENDCASE
ENDSELECT
ENDFUNCTION
what does the error mean, have checked spellings etc
regards
dave