-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFolderManager.sb
78 lines (78 loc) · 3.05 KB
/
FolderManager.sb
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
' Program Folder Manager 0.5
' Copyright © 2014-2015 Nonki Takahashi. The MIT License.
' Repository https://programdbsb.codeplex.com
'
' History:
' 0.5 2015-12-21 Added search folders. (CRK000-3)
' 0.41 2015-12-16 #2 Changed for Windows 10. (CRK000-2)
' 0.3 2014-06-13 Supported sub folders. (CRK000-1)
' 0.2 2014-06-06 Added other folders. (CRK000-0)
' 0.1 2014-06-04 Created. (CRK000)
'
Settings_GetName()
Settings_GetFolder()
roots[1] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic"
roots[2] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Challenge of the Month\Copy"
roots[3] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Challenge of the Month\GroupPaint"
roots[4] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Challenge of the Month\MoonLander"
roots[5] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Challenge of the Month\Robot"
roots[6] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Challenge of the Month\Zodiac"
roots[7] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Blog\tempo"
roots[8] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Blog\Timer"
roots[9] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Enthusiasts\Filipe"
roots[10] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Forum\Big number"
roots[11] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Forum\Multiplayer"
roots[12] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Small Basic Forum\Neural Network"
roots[13] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\TechNet Wiki\Error"
roots[14] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\TechNet Wiki\How To Debug"
roots[15] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Tony Free\Firebirds"
roots[16] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\Tony Free\Fruit"
roots[17] = "C:\Users\Nonki\OneDrive\Documents\SmallBasic"
roots[18] = "C:\Users\Nonki\OneDrive\Documents\SmallBasic\Shapes\Art"
Settings_GetSubFolders()
filename = path + "ProgramScanner.settings"
Settings_Write()
TextWindow.WriteLine(filename)
TextWindow.WriteLine(settings)
Sub Settings_GetFolder
' param filename
' return path
p = 1
bs = Text.GetIndexOf(Text.GetSubTextToEnd(filename, p), "\")
While 0 < bs
p = p + bs
bs = Text.GetIndexOf(Text.GetSubTextToEnd(filename, p), "\")
EndWhile
path = Text.GetSubText(filename, 1, p - 1)
EndSub
Sub Settings_GetSubFolders
' param roots - array of root folder names
' return settings - array of root and sub folder names
nRoot = Array.GetItemCount(roots)
nSub = 0
For i = 1 To nRoot
nSub = nSub + 1
settings[nSub] = roots[i]
dir = File.GetDirectories(roots[i])
nDir = Array.GetItemCount(dir)
For j = 1 To nDir
nSub = nSub + 1
settings[nSub] = dir[j]
EndFor
EndFor
EndSub
Sub Settings_GetName
' return filename
filename = File.GetSettingsFilePath()
EndSub
Sub Settings_Read
' param filename
' return settings
settings = File.ReadContents(filename)
EndSub
Sub Settings_Write
' param filename
' param settings
' return result
result = File.WriteContents(filename, settings)
EndSub