Save and load custome settings.
Moderator: DosItHelp
-
- Posts: 54
- Joined: 10 Nov 2011 20:40
Save and load custome settings.
Hey, I dont know where to start with this one. I want to add a settings option to my program and make it so you can save your custom settings. Color/Font/Size ect. Is there any right way to go about this?
Re: Save and load custome settings.
'
Code: Select all
if not exist "config.CMD" >"config.CMD" (
echo.set "this=option"
echo.set "that=option"
) &call "config.CMD"
-
- Posts: 54
- Joined: 10 Nov 2011 20:40
Re: Save and load custome settings.
That simple? Is there anyway to have the user custom name it?
Re: Save and load custome settings.
'
That depends, do you want an interactive script ?
That depends, do you want an interactive script ?
Code: Select all
set /p "$config.file=enter filename or press enter:" ||set "$config.file=config"
set "$config.file=%$config.file%.CMD"
if not exist "%$config.file%" >"%$config.file%" (
echo.set "this=option"
echo.set "that=option"
) &call "%$config.file%"
-
- Posts: 54
- Joined: 10 Nov 2011 20:40
Re: Save and load custome settings.
Well not really, Just a simple menu for example that I can save and re-load with a browser
Saving it
:Settings
Choose Color:
Choose Font:
Saving...
Ect
Loading it
Choose file to load:
Displays a file in the folder called CSSettingFile.bat
I know how to make the menu just not sure how to go about for coding.
Saving it
:Settings
Choose Color:
Choose Font:
Saving...
Ect
Loading it
Choose file to load:
Displays a file in the folder called CSSettingFile.bat
I know how to make the menu just not sure how to go about for coding.
Re: Save and load custome settings.
'
how about:
how about:
Code: Select all
@echo off &setlocal enableExtensions enableDelayedExpansion
:main ()
::(
call :load "()"
echo.hello world
pause
call :save "()"
::)
exit /b 0
:load ()
::(
cls
dir /b /a:-d
echo.
set /p "$cfg.file=Enter filename to load:" ||goto :load "()"
call "!$cfg.file!" ||goto :load "()"
::)
exit /b 0
:save ()
::(
set /p "$cfg.file=Enter filename to save:" ||goto :save "()"
set /p "$color=Choose Color:" ||goto :save "()"
set /p "$font=Choose font:" ||goto :save "()"
>"!$cfg.file!" (
echo.set "$color=!$color!"
echo.set "$font=!$font!"
)
::)
exit /b 0
-
- Posts: 54
- Joined: 10 Nov 2011 20:40
Re: Save and load custome settings.
See here is the problem I am still new to this and don't know what most of that means haha. I think I am ahead of myself at the moment.