Loopback
|
Posted: Thu Apr 29, 2010 10:42 Post subject: |
|
|
Точно, забыл.
Code: |
$text = FileRead(@ScriptDir & "\WinBars.txt")
$aBarData = StringSplit($text, "[Buttonbar]", 1)
$nBarCount = 1
For $i = 1 To $aBarData[0]
$sBarName = StringFormat("bar%03d.bar", $nBarCount)
$counter = 1
While 1
$cmd = StringRegExp($aBarData[$i], "(?m)^cmd" & $counter & "=(.+)$", 1)
If IsArray($cmd) Then
IniWrite($sBarName, "Buttonbar", "Buttoncount", $counter)
IniWrite($sBarName, "Buttonbar", "cmd" & $counter, StringStripWS($cmd[0], 3))
$menu = StringRegExp($aBarData[$i], "(?m)^menu" & $counter & "=(.+)$", 1)
If IsArray($menu) Then IniWrite($sBarName, "Buttonbar", "menu" & $counter, StringStripWS($menu[0], 3))
$button = StringRegExp($aBarData[$i], "(?m)^button" & $counter & "=(.+)$", 1)
If IsArray($button) Then IniWrite($sBarName, "Buttonbar", "button" & $counter, StringStripWS($button[0], 3))
$param = StringRegExp($aBarData[$i], "(?m)^param" & $counter & "=(.+)$", 1)
If IsArray($param) Then IniWrite($sBarName, "Buttonbar", "param" & $counter, StringStripWS($param[0], 3))
$path = StringRegExp($aBarData[$i], "(?m)^path" & $counter & "=(.+)$", 1)
If IsArray($path) Then IniWrite($sBarName, "Buttonbar", "path" & $counter, StringStripWS($path[0], 3))
$iconic = StringRegExp($aBarData[$i], "(?m)^iconic" & $counter & "=(.+)$", 1)
If IsArray($iconic) Then IniWrite($sBarName, "Buttonbar", "iconic" & $counter, StringStripWS($iconic[0], 3))
Else
ExitLoop
EndIf
$counter += 1
Wend
If $counter > 1 Then
$nBarCount +=1
EndIf
Next
|
|
|