WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Winbatch Studio
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Custom Syntax Colorization

 Keywords: Custom Syntax Color Colorize Colorization WinBatch Studio  

Question:

I would like to create custom colorization for a language other than WIL in WinBatch studio.

Answer:

WinBatch Studio is designed specifically as an editor for WIL scripts. However you can create your own color customization files for any file type. Lets say you would like to colorize .SAM file types. And you would like to colorize the keywords: samInfo and samVersion. You would also like to colorize the constant: CRLF
  1. First you will need to create your customized .CLR file. The file format would look like this: Name the file SAM.CLR
    [COLORS]
    ;Colors for Keywords (=1), Quoted Strings, Comments
    ;Default test and backgrond defined in syntax coloring dialog
    ;Additional colors defined here
    
    CONSTANT=128,0,128
    
    [KEYWORDS]
    saminfo = 1
    samversion = 1
    CRLF = CONSTANT
    

  2. Next you will need to modify the registry. Start by adding a value to this registry key: 'HKEY_CURRENT_USER\Software\Wilson WindowWare\WinBatch Studio\Settings\File mapping'. Add a new string value: Named "SAM"="SAM".

  3. Now you will need to create a new key under 'HKEY_CURRENT_USER\Software\Wilson WindowWare\WinBatch Studio\Settings\File types\SAM Files'. It should contain the following values:
    "AddToFileDialog"=dword:00000001
    "FileOpenMask"="SAM Files|*.sam"
    "Keywords"="SAM.clr"
    "Comment Start 1"=""
    "Comment End 1"=""
    "Comment Start 2"=""
    "Comment End 2"=""
    "Extra word chars"=""
    "Terminator chars"=""
    "Start chars"=""
    "Case"=dword:00000000
    "Run command"=""
    "Chroma"=dword:00000001
    "Tab size"=dword:00000003
    "Keep tabs"=dword:00000001
    "Show tabs"=dword:00000001
    "Font name"="Courier New"
    "Font size"=dword:00000009
    "Insert"=dword:00000001
    "Lock files"=dword:00000000
    "Line end type"=dword:00000000
    
Now when you load a .sam file into WInBatch studio and type the following keywords/contant: samInfo,samVersion and CRLF. They should show up colorized. If you would like to change the color of the key word or contants simply go to the WinBatch Studio View|Option menu and select the FileTypes Tab. You will now see the .SAM file type listed in the dropdownlist. Select .SAM filetypes then modify any of the customization properties.
Article ID:   W18449
Filename:   Custom Syntax Colorization.txt
File Created: 2012:01:23:12:54:08
Last Updated: 2012:01:23:12:54:08