It is currently April 16th, 2024, 7:15 pm

Config Applet Help

Share and get help with Plugins and Addons
Frostschaden
Posts: 90
Joined: January 26th, 2013, 9:11 pm

Config Applet Help

Post by Frostschaden »

I'm using the rainmeter skin config by fediafedia, and am only allowed so many entries, I get the following error "array variable has incorrect number of subscripts or subscript dimension range exceeded"

Here is the config au3 file, is it possible to change the number of entries allowed and if so where do I input this information

Code: Select all

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ScrollBarConstants.au3>
#include <array.au3>
#include <GuiStatusBar.au3>
#include <GuiEdit.au3>
#include <GuiButton.au3>
#include <Misc.au3>
#include <String.au3>
#Include <File.au3>
Opt("TrayIconHide", 1)

$var = IniRead("settings.inc", "Refresh", "Command","")
$var2 = IniRead("settings.inc", "Color", "Hex","")
$var3 = IniRead("settings.inc", "Font", "FontFace","")
$var4 = IniRead("settings.inc", "AppTitle", "Title","")

$Gui = GUICreate($var4, 200, 250, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetBkColor($var2)

$Drag = GUICtrlCreatePic("header.jpg", 0, 0, 200, 40, Default, $GUI_WS_EX_PARENTDRAG)
$VariableList = GUICtrlCreateList("", 15, 58, 170, 140, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$WS_HSCROLL,$WS_VSCROLL))
GUICtrlSetFont(-1, 9, 400, 0, $var3)
$VariableDescripton = GUICtrlCreateLabel("", 15, 197, 250, 18)
GUICtrlSetFont(-1, 9, 400, 0, $var3)
GUICtrlSetColor(-1, 0x000000)
$VariableInput = GUICtrlCreateInput("", 15, 217, 110, 21)
GUICtrlSetFont(-1, 9, 400, 0, $var3)
$ExitButton = GUICtrlCreateLabel("x", 165, 40, 20, 18, $SS_CENTER)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI")
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent($ExitButton, "clickedExit")
$SetButton = GUICtrlCreateButton("Set", 130, 216, 55, 23)
GUICtrlSetFont(-1, 9, 400, 0, $var3)

GUISetState(@SW_SHOW)

Dim $VarName[200]
Dim $VarDescription[200]
Dim $iniFiles[200]
Dim $VarCount = 0
Dim $FilesCount = 0
Dim $EndIt = 0
Dim $Foundini = 0

$CfgFile = FileOpen ("RainConfigure.cfg", 0)
$VariableSection = FileReadLine ($CfgFile)

Do
	$VarCount = $VarCount + 1
	$VarName[$VarCount] = FileReadLine ($CfgFile)
	$VarDescription[$VarCount] = FileReadLine ($CfgFile)
	If $VarName[$VarCount] = "[Files]" Then $EndIt = 1
Until $EndIt = 1

$iniFiles[1] = $VarDescription[$VarCount]
$FilesCount = $FilesCount + 1

While @error <> -1
	$FilesCount = $FilesCount + 1
	$iniFiles[$FilesCount] = FileReadLine ($CfgFile)
WEnd

FileClose ($CfgFile)
$VarCount = $VarCount - 1
$FilesCount = $FilesCount - 1

For $ListCount = 1 to $VarCount
GUICtrlSetData($VariableList,$VarName[$ListCount] & "|")
Next

While 1

	$nMsg = GUIGetMsg()

	Switch $nMsg

		Case $GUI_EVENT_CLOSE
			FileClose($CfgFile)
			Exit

	Case $ExitButton
			FileClose($CfgFile)
			Sleep(300)
			Exit


		Case $VariableList
			$CurrentVarName = GUICtrlRead($VariableList)
			For $ListCount = 1 to $VarCount
				if $VarName[$ListCount] = $CurrentVarName Then
					$CurrentVarDescription = $VarDescription[$ListCount]
				EndIf
			Next
			GUICtrlSetData($VariableDescripton, $CurrentVarDescription)
			For $ListCount = 1 to $FilesCount
				$Temp = IniRead($iniFiles[$ListCount], "Variables", $CurrentVarName,"")
				If $Temp <> "" then
					$ini2Edit = $iniFiles[$ListCount]
					GUICtrlSetData($VariableInput, $Temp)
					ExitLoop
				EndIf
			Next

		Case $SetButton

			For $ListCount = 1 to $FilesCount
				$Temp = IniRead($iniFiles[$ListCount], "Variables", $CurrentVarName,"")
				ShellExecute("refresh.exe", $var)
				If $Temp <> "" then
					IniWrite ($iniFiles[$ListCount], "Variables", $CurrentVarName, GUICtrlRead($VariableInput))
				EndIf
			Next

EndSwitch
WEnd
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Config Applet Help

Post by eclectic-tech »

Do you have more than 200 variables? If not the problem may be in the RainConfigure.cfg file (post that file, if there are less than 200 variables, so we can check it's structure).

If you need more variable definitions, you could try to increase the "200" in the 3 DIM statements to a higher number (like 250 or 300):

Code: Select all

...
Dim $VarName[300]
Dim $VarDescription[300]
Dim $iniFiles[300]
...

But it is hard to believe you need more than 200 variables in a skin...
Frostschaden
Posts: 90
Joined: January 26th, 2013, 9:11 pm

Re: Config Applet Help

Post by Frostschaden »

The problem was on my end, one of the entries was incorrect, thanks for the help though.