1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 19:20:25 +00:00

Fix to config.txt file error catching for auto indent spacing

This commit is contained in:
SteveMcNeill 2015-08-20 11:13:25 -04:00
parent 8abc34c99e
commit 0db73ad071

View file

@ -7,18 +7,18 @@ DIM SHARED LoadedIDESettings AS INTEGER
DIM SHARED MouseButtonSwapped AS _BYTE DIM SHARED MouseButtonSwapped AS _BYTE
IF LoadedIDESettings = 0 THEN IF LoadedIDESettings = 0 THEN
'We only want to load the file once when QB64 first starts 'We only want to load the file once when QB64 first starts
'Other changes should occur to our settings when we change them in their appropiate routines. 'Other changes should occur to our settings when we change them in their appropiate routines.
'There's no reason to open and close and open and close the same file a million times. 'There's no reason to open and close and open and close the same file a million times.
LoadedIDESettings = -1 LoadedIDESettings = -1
ConfigFile$ = "internal/config.txt" ConfigFile$ = "internal/config.txt"
ConfigBak$ = "internal/config.bak" ConfigBak$ = "internal/config.bak"
GOSUB CheckConfigFileExists 'make certain the config file exists and if not, create one GOSUB CheckConfigFileExists 'make certain the config file exists and if not, create one
IF INSTR(_OS$, "WIN") THEN IF INSTR(_OS$, "WIN") THEN
result = ReadConfigSetting("AllowIndependentSettings", value$) result = ReadConfigSetting("AllowIndependentSettings", value$)
IF result THEN IF result THEN
@ -181,12 +181,9 @@ IF LoadedIDESettings = 0 THEN
result = ReadConfigSetting("IDE_IndentSize", value$) result = ReadConfigSetting("IDE_IndentSize", value$)
ideautoindentsize = VAL(value$) ideautoindentsize = VAL(value$)
if result = 0 then if ideautoindentsize < 1 OR ideautoindentsize > 64 then
ideautoindentsize = 4 ideautoindentsize = 4
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", "4" WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", "4"
else
IF ideautoindentsize < 0 OR ideautoindentsize > 64 THEN ideautoindentsize = 4
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_IndentSize", "4"
end if end if
result = ReadConfigSetting("IDE_CustomFont", value$) result = ReadConfigSetting("IDE_CustomFont", value$)