Code folding for the Winbatch (WIL) Language
Posted: Wed Apr 05, 2006 1:53 pm
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
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