Long time user, first time poster. Greetings and salutations!
I'm using a fairly obscure language that bears a lot of resemblance to C and BASIC. I've been working on getting the code folding to work correctly for this language and having mixed results.
An example of the code:
Using the following options in the wordfile allows the Function, Sub and While code to fold perfectly.
/Open Fold Strings = "Function" "Sub" "While"
/Close Fold Strings = "End Function" "End Sub" "Wend"
/Ignore Fold Strings = "Exit Sub" "Exit Function"
My problem comes in when I try to set it up to fold If/Endif code. I tried the following, but got strange results:
/Open Fold Strings = "Function" "Sub" "While" "If" "Endif Else"
/Close Fold Strings = "End Function" "End Sub" "Wend" "Endif"
/Ignore Fold Strings = "Exit Sub" "Exit Function"
Fold marks are missing from some If statements... Folding for previously working code now ends the folds in the wrong spots... Any help would be appreciated.
I'm using a fairly obscure language that bears a lot of resemblance to C and BASIC. I've been working on getting the code folding to work correctly for this language and having mixed results.
An example of the code:
Code: Select all
SUB DELFILES(INFILE$)
STRING INFILE$
WRITE #1; TAB$ + TAB$ + "Deleting " + INFILE$
ERROR.OCCURRED = -1
FILE.OPEN = 0
WHILE ERROR.OCCURRED
ERROR.OCCURRED = 0
IF NOT FILE.OPEN THEN BEGIN
WRITE #1; TAB$ + TAB$ + TAB$ + "Opening file " + INFILE$
OPEN INFILE$ AS 4
ENDIF
IF ERROR.OCCURRED THEN BEGIN
IF CHAR.STRING$ <> "80204010" THEN BEGIN
GOSUB DELFILES.LOG.ERROR
ENDIF ELSE BEGIN
ERROR.OCCURRED = 0
ENDIF
ENDIF ELSE BEGIN
FILE.OPEN = -1
WRITE #1; TAB$ + TAB$ + TAB$ + "Deleting file " + INFILE$
DELETE 4
IF ERROR.OCCURRED THEN BEGIN
GOSUB DELFILES.LOG.ERROR
ENDIF
ENDIF
WEND
EXIT SUB
DELFILES.LOG.ERROR:
WRITE #1; TAB$ + TAB$ + \
"ERROR LOGGED = " + \
"HT" + \
RIGHT$("00" + STR$(HT.ERRF%),2) + \
HT.ERR$ + \
CHAR.STRING$
I% = ADXERROR(0,ASC("H"),004,1,9,ERR.MESSAGE$)
WAIT;300000
RETURN
END SUB
/Open Fold Strings = "Function" "Sub" "While"
/Close Fold Strings = "End Function" "End Sub" "Wend"
/Ignore Fold Strings = "Exit Sub" "Exit Function"
My problem comes in when I try to set it up to fold If/Endif code. I tried the following, but got strange results:
/Open Fold Strings = "Function" "Sub" "While" "If" "Endif Else"
/Close Fold Strings = "End Function" "End Sub" "Wend" "Endif"
/Ignore Fold Strings = "Exit Sub" "Exit Function"
Fold marks are missing from some If statements... Folding for previously working code now ends the folds in the wrong spots... Any help would be appreciated.