[futurebasic] Went back to cases

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2006 : Group Archive : Group : All Groups

From: Brian Heibert <bheibert@...>
Date: Thu, 26 Jan 2006 22:51:24 -0500
OK,

I see why using CASE is better
but now I have 3 errors:

Error: Unknown Statement: 'dataLine$'
in file HBasic.proj:HBASIC.MAIN at line 476 in ParseEFLines
•dataLine$•     = EDIT$( _cEdit, lineNum )
Error: Unknown Statement: 'keyWord$'
in file HBasic.proj:HBASIC.MAIN at line 478 in ParseEFLines
•keyWord$•      = LEFT$(dataLine$,spacePosition-1)
Error: Unknown Statement: 'restOfLine$'
in file HBasic.proj:HBASIC.MAIN at line 479 in ParseEFLines
•restOfLine$•   = MID$(dataLine$,spacePosition+1)

what do I do about them?

LOCAL FN ParseEFLines (efID as Long)
dim wnum,wtit$
dim rs$
efHndl& = TEhandle( _cEdit )
dataLine$     = EDIT$( _cEdit, lineNum )
spacePosition = INSTR(1, dataLine$+" "," ")
keyWord$      = LEFT$(dataLine$,spacePosition-1)
restOfLine$   = MID$(dataLine$,spacePosition+1)
FOR lineNum = 1 TO efHndl&..TEnLines%
DIM efHndl&, dataLine$, lineNum
DIM spacePosition
SELECT UCASE$( keyWord$ )
CASE "WIN#"
' wnumx = VAL( restOfLine )
'  wtx$  = MID$(restOfLine,3)
wnumx = RIGHT$(VAL(restOfLine),6)
wtxt$ = RIGHT$(restOfLine,8)
WINDOW wnumx, wtx$ // make the new window
WINDOW _editor  // and return to editor window

CASE "PRINT"
out$ = RIGHT$(restOfLine,6)
WINDOW wnumx
PRINT out$
WINDOW _editor
end select
NEXT lineNum
END FN