Uses
"File"
,
"Console"
Uses
"TBGL"
Dim
sListOfKeywords
As
String
Dim
Keyword()
As
String
Dim
nKeywords
As
Long
Dim
nNewKeywords
As
Long
Dim
sCustomKeywords
As
String
Dim
Lines()
As
String
Dim
nLines
As
Long
Dim
CombinedLines()
As
String
Dim
i
As
Long
Dim
newKeyword
As
String
Dim
userKeywordsFile
As
String
Dim
sFileContentINC
As
String
Dim
sFileContentINI
As
String
PrintL
"Generating include file..."
sListOfKeywords =
APP_ListKeywords
nKeywords =
Parse
(sListOfKeywords, Keyword, $
TAB
)
sFileContentINC =
"' This is include file of Zak's custom names for TBGL"
+ $
CRLF
(2)
For
i = 1
To
nKeywords
If
StartsWith(Keyword(i),
"TBGL_"
)
Then
nNewKeywords += 1
newKeyword = PetrsTBGLNameToZaksTBGLName(Keyword(i))
sFileContentINC +=
"ALIAS "
+ Keyword(i) +
" AS "
+ newKeyword + $
CRLF
sFileContentINI += newKeyword + $
CRLF
End
If
Next
FILE_Save
(
APP_Path
+
"\Inc\" + "
CustomTBGLFunctionNames.inc", sFileContentINC)
PrintL
"Generating custom keywords for thinAir..."
PrintL
userKeywordsFile =
APP_Path
+
"\thinAIR\Syntax\thinBasic\" + "
thinBasic_Keywords_Usr.ini"
If
FILE_Size(userKeywordsFile) = 0
Then
FILE_Save
(userKeywordsFile, sFileContentINI)
Else
sCustomKeywords =
FILE_Load
(userKeywordsFile)
nLines =
Parse
(sCustomKeywords, Lines, $
CRLF
)
ReDim
Preserve
Lines(nLines+nNewKeywords)
For
i = 1
To
nNewKeywords
newKeyword =
Parse
$(sFileContentINI, $
CRLF
, i)
Lines(nLines+i) = newKeyword
Next
Array
Unique Lines, CombinedLines
sFileContentINI =
Join
$(CombinedLines, $
CRLF
)
FILE_Save
(userKeywordsFile, sFileContentINI)
End
If
PrintL
PrintL
"Done, press any key..."
WaitKey
Function
PetrsTBGLNameToZaksTBGLName( sNameIn
As
String
)
As
String
sNameIn = Remove$(sNameIn,
"TBGL_"
)
sNameIn +=
"_GL"
Return
sNameIn
End
Function