Code folding for the Winbatch (WIL) Language

This forum should be used for all code folding problems, questions or suggestions. You can also use this forum to request folding support for a new language.
Post Reply
kevin.bell62
Posts: 2
Joined: Fri Jan 20, 2006 3:37 pm

Code folding for the Winbatch (WIL) Language

Post by kevin.bell62 »

Hello!

Hopefully I am posting this in the right place. I am requesting code folding for the Winbatch (Windows Interface Language). The info is as below:

Extensions: .wbt, .web, .wil, .wdl
Line Comment: ;
Block Comment: none
Begin: if
End: endif
Begin: switch
End: endswitch
Begin: gosub
End: return
Begin: for
End: next
Begin: while
End: endwhile
Begin: #definefunction
End: #endfunction
Begin: #definesubroutine
End: #endsubroutine
Begin: foreach
End: next
Sample Code:

if x==y then
_do_true_stuff
else
_do_false_stuff
endif

;--------------------------------------------------

; "select" may be used interchangably with "switch"

switch (integer_value)
case 1
case 2
_do_for_one ; will process both 1 and 2 condition
break
case 3
_do_for_two ; will process if integer_value = 3
break
case (integer_value)
_fall_through_processing
break
endswitch

;--------------------------------------------------

gosub _a_subroutine

:_a_subroutine ; subroutines start with the ':' character

_sub_routine_code

return ; returns processing back to line after gosub call

;--------------------------------------------------

for x = 0 to 100

_do_something_here

break ;; this would exit the loop early
continue ;; this causes the loop to start over at next iteration

next

;--------------------------------------------------

while (@true)

_do_something_here

break ;; this would exit the loop early
continue ;; this causes the loop to start over with condition re-test

endwhile

;--------------------------------------------------

result = _test_function(3)

#definefunction _test_function(_an_integer)

_a_value_defined = 1 ;; this is local to function

_an_integer = _an_integer + 1

return _an_integer

#endfunction

;--------------------------------------------------

result = _test_sub(3)

#definesubroutine _test_sub(_an_integer)

_a_value_defined = 1 ;; this is global to entire program

_an_integer = _an_integer + 1

return _an_integer

#endsubroutine

;--------------------------------------------------

foreach objPrinter in colInstalledPrinters

sPrinterInfo = strcat(sPrinterInfo, "Name: ", objPrinterName, @crlf)

next


Thanks a lot! KDB
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This is definitely the correct place to post this code folding request ;)

The WinBatch code folding changes have been made and the new xFolder.dll can be found here:

http://www.zeusedit.com/z300/xFolder.zip

To install this new dll backup the current dll and replace it with the one contained in the zip file.

To complete the install you will need to create a WinBatch document type and enable the code folding option.

If you find any problems with the folding, just post a bug report to the end of this thread.

Cheers Jussi
Last edited by jussij on Thu May 04, 2006 9:22 am, edited 1 time in total.
kevin.bell62
Posts: 2
Joined: Fri Jan 20, 2006 3:37 pm

Post by kevin.bell62 »

Thank you Jussi!

Seems to be working great. The only problem I can see is that I forgot to mention that "if" statements can be 1 liners:

if x == y then goto spork

with no "endif". I don't know how you would trap that one anyway, so my thanks yet again!

I have been using Zeus for my Ruby scripts and will now use it for my winbatch scripting as well.

Thanks for a fine product! KDB
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

A new xFolder.zip file has just been uploaded and it should fix the problem with these one line if statements.

Cheers Jussi
Post Reply