thinbasic\compilers-subdir does not contain the freebasic-stuff.
Even if the fb-version was not up-to-date- there was an .inc-file for thinbasic within fb\inc.
(thinbasic\thinAir\Syntax also provides some Freebasic-autocomplete)
I would like to see also #compiled language=oxygenbasic for dynamic dll-production controlled by a thinbasic-script
Secondary - and much more important to me: always when i reinstall tb (new version over the previous) it overwrites
thinbasic\compilers\thinbasic_compilers_USR.ini
thinBasic\thinAir\tools\thinAir_tools_USR.ini
thinBasic\thinAir\Syntax\thinbasic\
thinBasic_Blocks_USR.ini
thinBasic_Calltips_USR.xml
thinBasic_Keywords_USR.ini
thinBasic_StartEnd_autoclose_USR.Ini
but this were not nescessary:
When thinbasic\thinair\thinAir.exe launches to read the tools for the menu it "knows" the current environmental variable USERNAME.
take the filenames as above make a copy of each and replace "USR" in the copied string with the environment-variables content.
so there are 2 strings as
name of shipped file:....................."thinBasic_Blocks_USR.ini"
name of file for the current user:....."thinBasic_Blocks_Eros.ini"
The function below is an incomplete sketch. It should be executed on each of the "_USR."-files and would create a copy of such file where
USR is replaced as described above. It is to take care also for changes, for example when new features are added to thinAir the .ini-file
is growing by new sections and/or keys so there is to check the version (optional a minVersion that is required only when major changes are
applied , likewise the filetype changes from .ini to .json or .xml)
Function ini_per_user(byval shippedFile as String) As Long
' for shippedFile pass like "thinbasic\compilers\thinbasic_compilers_USR.ini"
Number nVersion
String sBackupFile, sSect(), sKey()
Long lState, lSects, lKeys, i, j
String sPersonalFile=Replace$(shippedFile, "_USR.", With "_" & App.Environ.Username & "."
If sPersonalFile = shippedFile Then Return %ERROR_Filename_without_USR
WHILE ( NOT FILE_EXISTS( sPersonalFile ))
IF (lState And 1) = 1 THEN
MsgBox "Unable to store data. Please ensure:
- thinBasic was not installed within a system-folder,
- the drive is not write-protected,
- there is sufficient available space on the drive,
- you launched thinAir with elevated privileges",
%MB_IconError, "problem of file-system-access"
Stop
ENDIF
FILE_SAVE( sPersonalFile, FILE_LOAD( shippedFile ) )
lState = 1 ' set bit 1
WEND
' first check whether this ini is aware of the last added keys or sections
nVersion = Val(ini_getkey(sPersonalFile, "Version", "Deployed", "0.0" ))
if nVersion < Val(ini_getkey( shippedFile, "Version", "Deployed", "0.0" )) Then
' present user-ini-file is an elder version and probably does not have all the sections and keys as the last version
' i.e. thinAir was improved and there are some new settings - or even the format has changed
' so check the version we require at least
If nVersion < Val(ini_getkey( shippedFile, "Version", "Minimum","0.0")) Then
' = user-file on the pc is too old- we can not use anything of it and need to replace it completely
' maybe some settings can be converted here reading the old format
return %ERROR_Below_Minimum_Version
end if
' format was not changed for this ini-file so it is to copy the values from sections and keys that are not present in sPersonalFile
' rename the personal file to become a temporary backup
sBackupFile = sPersonalFile & ".bak"
File_Rename sPersonalFile, sBackupFile
' load the shipped file as string and save it to sPersonalFile
FILE_SAVE( sPersonalFile, FILE_LOAD( shippedFile ) )
' list all sections in the backup
lSects = Ini_GetSectionsList( sBackupFile, sSect )
While lSects
' list all keys in the section
lKeys = Ini_GetSectionsKeyList(sBackupFile, sSect(lSects), sKey())
while lKeys
' write all keys values as stored in the backup into the new personal file
ini_SetKey(sPersonalFile,sSect(lSects),sKey(lKeys), Ini_getKey(sBackupFile,sSect(lSects), sKey(lKeys)))
lKeys -= 1
wend
lSects -= 1
wend
'all settings from backup of the previous personal file are written
end if
' Function = %NoError
' keys and values can be read now from sPersonalFile
end function
So every user who has an account on the same PC already gets his personal template for these settings and tools etc.
PC-specific settings that are depending on the present engine (graphics adapter, monitors count & resolutions, soundcard etc) will usually be the same for
all users on the same PC so there is no need to adjust the settings for each user when the first user made any required changes.
To avoid snooping through another users ini-file it were better to put such keys and theirs values into a separate ini-file where all in common used settings are provided.
That would also apply to some shared features for example a collection of code-snippets - expandeable and useable by all users on a pc.
e.g.
"thinBasic_hostSystem_SHIDEVDEF.INI" (shipped developers defaults)
"thinBasic_hostSystem_SHARED.INI" (by thinAir created copy )
PS. screenshot applies to the version previous to the last beta (also 1.14..0.0 but the site did not work at that time
a shocking amount of memory abused by thinAir - wild guess: either scintilla is leaking or there is some regEx-pattern ( too many possible ways or too many unlimited repetitions)
As you can see - there is a content-saver (small dialog above task-manager- sadly not working for thinAir when it becomes unresponsive) thats purpose is to save data of a windows control.
I had it many times already since thinAir works using scintilla that thinAir crashed or became unresponsive and i was not able to save code where i typed in for many hours. Why doesn't thinAir come with its own thinAir\autosave-subfolder where it even saves unnamed files with a default name as soon as 1000 chars are typed and from then it could work timed or focus-controlled
(i.e. if a codewindow loses focus to any other control of thinAir or thinAir loses focus to another running process )