-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathini-demo1.bas
45 lines (33 loc) · 1.15 KB
/
ini-demo1.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'INI Manager - demo 1
'
'syntax: WriteSetting file$, section$, key$, value$
'write a new key/value pair to an .ini file or update an existing
'if the file doesn't exist, it'll be created.
'----------------------------------------------------------------
'(brackets in section names are optional; will be added automatically anyway)
WriteSetting "test.ini", "[general]", "version", "Beta 4"
GOSUB Status
'subsequent calls don't need to mention the file again
WriteSetting "", "general", "date", DATE$
GOSUB Status
WriteSetting "", "general", "time", TIME$
GOSUB Status
WriteSetting "", "credits", "author", "Fellippe Heitor"
GOSUB Status
WriteSetting "", "contact", "email", "[email protected]"
GOSUB Status
WriteSetting "", "contact", "twitter", "@FellippeHeitor"
GOSUB Status
PRINT "File created/updated. I'll wait for you to check it with your editor of choice."
PRINT "Hit any key to continue..."
PRINT
a$ = INPUT$(1)
WriteSetting "", "general", "version", "Beta 4 - check the repo"
GOSUB Status
PRINT "File updated again. Go check it if you will."
END
Status:
COLOR 7: PRINT IniINFO
COLOR 15: PRINT IniLastSection$; IniLastKey$: PRINT
RETURN
'$include:'ini.bm'