Dave:
The version of PBSF.BAS on the 3.x distribution disks in the EXAMPLE
directory has a bug in it that turns off reformatting after an $IF 0
statement. This is Not Good.
The corrected section of code should read:
FUNCTION FormatLine$(BYVAL Source$)
STATIC InComment
Original$ = LTRIM$(RTRIM$(Source$, ANY CHR$(9,32)), ANY CHR$(9,32))
Work$ = UCASE$(Original$)
TempStart = -1
IF LEN(Work$) = 0 THEN
EXIT FUNCTION
END IF
KeyWord$ = UCASE$(EXTRACT$(Work$, ANY " ,="))
IF InComment = %TRUE THEN
FormatLine$ = Source$
END IF
SELECT CASE InComment
CASE %TRUE
IF KeyWord$ = "$ENDIF" THEN
InComment = %FALSE
TempStart = 0
GOTO ExtendLine
END IF
FormatLine$ = Source$
EXIT FUNCTION
CASE %FALSE
IF UCASE$(LEFT$(Work$, 5)) = "$IF 0" THEN
InComment = %TRUE
TempStart = 0
GOTO ExtendLine
ELSEIF (ASCII(Work$) = 39) OR ... etc....
[... some code removed for brevity....]
END SELECT
[ ...much code removed for brevity....]
END FUNCTION
Please investigate my fix and revise the distribution accordingly in
future releases.
Jamshid
--- Maximus/2 2.01wb
---------------
* Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070)
|