TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: DAVE NAVARRO
from: JAMSHID KHOSHRANGI
date: 1995-09-17 15:54:00
subject: PBSF.BAS bug fix

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.