Dear members,

Already a version of the syntax for TextPad 4 editor is published
on this board.
In comparison with all other editors we like the enormous amount
of available defined syntax formats and the easiest way of
configure a new one.

The real differences with previous published ones are
the section syntax part.
The following keys difference:


  • KeyWordLength = 0
    (keyword aren't restricted by any length)
  • InitKeyWordChars = $A-Za-z
    (keywords may also be started with a $ character)
  • KeyWordChars = A-Za-z0-9_
    (keywords may also contain a _ character)
  • BracketChars = [()]
    ({ and } are not legal brackets by kixtart)
  • OperatorChars = +-*/<>&|=?
    (the characters !, ~ and ^ are not defined
    characters for kixtart)
    (the characters % and @ are characters, which will
    handle in a normal way. the @ character of macros was
    add as prefix for available kixtart macros. see section of
    defined keywords)
  • StringAlt = '
    (a string starts not only with a " character, but it can also
    be started with a ' character)

The idea of showing "commands and functions not supported since kix2001"
in another colour came from member cj.

The kixtart.syn is:

code:

; TextPad syntax definitions
;
; (c) scripting@wanadoo.nl - 2001
;
; 20-may-2001 kixtart 2001 beta 2a
;

C=1

[Syntax]
Namespace1 = 5
IgnoreCase = Yes
KeyWordLength = 0
InitKeyWordChars = $A-Za-z
KeyWordChars = A-Za-z0-9_
BracketChars = [()]
OperatorChars = +-*/<>&|=?
PreprocStart =
SyntaxStart =
SyntaxEnd =
CommentStart =
CommentEnd =
CommentStartAlt =
CommentEndAlt =
SingleComment = ;
SingleCommentCol =
SingleCommentAlt =
SingleCommentColAlt =
StringStart = "
StringEnd = "
StringAlt = '
StringEsc =
CharStart = "
CharEnd = "
CharEsc =

; kixtart - commands
[Keywords 1]
BEEP
BIG
BREAK
CALL
CASE
CD
CLS
COLOR
COOKIE1
COPY
DEBUG
DEL
DIM
DISPLAY
DO
EACH
ELSE
ENDIF
ENDFUNCTION
ENDSELECT
EXIT
FILE
FLUSHKB
FOR
FUNCTION
GET
GETS
GLOBAL
GO
GOSUB
GOTO
IF
IN
LIST
LOOP
MD
NEXT
OFF
ON
PASSWORD
PLAY
QUIT
RD
REDIM
RETURN
RUN
SELECT
SET
SETL
SETM
SETTIME
SHELL
SLEEP
SMALL
STEP
TO
UNTIL
USE
WHILE

; kixtart - functions
[Keywords 2]
AddKey
AddPrinterConnection
AddProgramGroup
AddProgramItem
Asc
At
BackupEventLog
Box
Chr
ClearEventLog
Close
CompareFileTimes
CreateObject
DecToHex
DelKey
DelPrinterConnection
DelProgramGroup
DelProgramItem
DelTree
DelValue
Dir
EnumGroup
EnumIPInfo
EnumKey
EnumLocalGroup
EnumValue
Execute
Exist
ExpandEnvironmentVars
GetDiskSpace
GetFileAttr
GetFileSize
GetFileTime
GetFileVersion
GetObject
Ingroup
Instr
KeyExist
Lcase
Len
LoadHive
LoadKey
LogEvent
Logoff
Ltrim
MessageBox
Open
ReadLine
ReadProfileString
ReadType
ReadValue
RedirectOutput
Rnd
Rtrim
SaveKey
SendKeys
SendMessage
SetAscii
SetConsole
SetDefaultPrinter
SetFileAttr
SetFocus
SetSystemState
SetTitle
SetWallPaper
ShowProgramGroup
Shutdown
SidToName
Split
Srnd
Substr
UBound
Ucase
UnloadHive
Val
VarType
VarTypeName
WriteLine
WriteProfileString
WriteValue

; kixtart - macros
[Keywords 3]
@address
@comment
@csd
@curdir
@date
@day
@domain
@dos
@error
@fullname
@homedir
@homedrive
@homeshr
@hostname
@inwin
@ipaddress0
@ipaddress1
@ipaddress2
@ipaddress3
@kix
@lanroot
@ldomain
@ldrive
@lm
@longhomedir
@lserver
@maxpwage
@mdayno
@month
@monthno
@primarygroup
@priv
@productsuite
@producttype
@pwage
@ras
@rserver
@scriptdir
@serror
@sid
@site
@startdir
@syslang
@time
@userid
@userlang
@wdayno
@wksta
@wuserid
@ydayno
@year

; kixtart - booleans
[Keywords 4]
AND
NOT
OR

; kixtart - commands and functions not supported since kixtart 4.00
[Keywords 5]
ExistKey
OleCallFunc
OleCallProc
OleCreateObject
OleEnumObject
OleGetObject
OleGetProperty
OleGetSubObject
OlePutProperty
OleReleaseObject


The following REGEDIT code will active document classes KiXtart
within TexpPad 4 with different kind of colors.
Before using it:

copy above syntax code into your TextPad 4 "Samples"
subdirectory with name kixtart.syn.

code:

REGEDIT4

[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\KiXtart]
"Type"=dword:00000002
"Members"=hex(7):2a,2e,6b,69,78,00,00
"Properties"=hex:46,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00
"SyntaxProps"=hex:01,00,00,00
"SyntaxFile"="kixtart.syn"
"WordChars"="_"
"Font0"=hex:08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,\
00,00,00,00,00,00,43,6f,75,72,69,65,72,20,4e,65,77,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00
"Font2"=hex:08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,\
00,00,00,00,00,00,43,6f,75,72,69,65,72,20,4e,65,77,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00
"TabStops"=hex:01,00,00,00,01,00,00,00,04,00,04,00,00,00,00,00,6c,05,0c,01,46,\
e1,4f,00,90,e1,57,00,18,0d,00,00,8a,88,50,00,ff,ff,ff,ff,38,ed,80,00,78,05,\
0c,01,00,01,00,00,fa,e2,46,00,38,ed,80,00,8d,00,00,00,78,05,0c,01,60,01,6e,\
00,e0,03,0c,01,64,ed,80,00,a4,f8,80,00,95,bc,4f,00,38,ed,80,00,01,00,00,00,\
e0,03,0c,01,a4,f8,80,00,01,00,00,00,01,00,00,00,e0,03,0c,01,18,0d,00,00,01,\
00,00,00,a4,9c,52,00,00,00,00,00,60,01,6e,00,28,ed,80,00,e4,f3,80,00
"Printer"=hex(7):57,49,4e,53,50,4f,4f,4c,00,48,50,20,4c,61,73,65,72,4a,65,74,\
20,34,4c,00,4c,50,54,31,3a,00,00
"PageSetup"=hex:fa,00,00,00,82,00,00,00,fa,00,00,00,82,00,00,00,01,00,00,00,00,\
00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00
"Header"="&l&f&r&d"
"Footer"="&p"
"UseDefault"=dword:00000000
"Colors"=hex:00,ff,ff,00,00,00,00,00,ff,00,00,00,ff,ff,ff,00,01,00,00,00,01,00,\
00,00,01,00,00,00,01,00,00,00,80,80,80,00,00,00,00,00,80,80,80,00,00,00,00,\
00,ff,00,00,00,00,00,00,00,ff,ff,00,00,00,00,00,00,00,ff,00,00,00,00,00,00,\
ff,00,00,00,00,00,00,00,ff,00,ff,00,00,00,00,00,ff,00,ff,00,00,00,00,00,01,\
00,00,00,01,00,00,00,a6,ca,f0,00,00,00,00,00,ff,00,00,00,00,00,00,00,a6,ca,\
f0,00,00,00,00,00,a6,ca,f0,00,00,00,00,00,80,00,00,00,00,00,00,00,00,00,80,\
00,01,00,00,00,01,00,00,00,00,00,00,00,ff,00,00,00,00,00,00,00,80,80,00,00,\
00,00,00,00


Remark about registry key WordChars:

code:

[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Document Classes\KiXtart]
"WordChars"="_"


Without this specification the variable f.e. $debug_mode will not
be displayed correctly. Without means that the debug part is
interpretated as boldsymbold instead of a part of a keyword.

The installation instruction to activate Kixtart with TextPad is:

code:

1. Copy syntax code (file calling: "kixtart.syn") into your
TextPad 4 "Samples" subdirectory.

2. Launch TextPad 4.

3. Close any open files.

4. From the Configure menu, choose Preferences.
The Preferences dialog box is displayed.

5. Select "Document Classes".

6a. Type a new class name in the empty box at the end of the list
of document classes: "KiXtart" for example.

6b. Click [Apply] to confirm the changes.

7. Click on the new "KiXtart" selection under Document Classes.

8a. Open the Syntax dialogue (= a subselection of Document Classes "KiXtart").

8b. Check the "Enable syntax highlighting" box and select the
"kixtart.syn" syntax file from the scroll list.
8c. Enter "_" character to "Other characters in words" box.
To handle names with "_" symbols in a correct way.

9a. Open the Tabulation dialogue *= a subselection of Document Classes "KiXtart").

9b. Enter 4 to "Default tab spacing" box.
9c. Enter 4 to "Indent Size" box.
9d. Check the "Convert new tabs to spaces" box.
9e. Check the "Convert existing tabs to spaces when saving files" box.

10. Click [Apply] to confirm the changes.

11. Click [OK] to complete changes.



A lot of other syntax definitions you can find on site
http://www.textpad.com
Greetings.

------------------
Site map:

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA