Jump to content

Search the Community

Showing results for tags 'subscript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 6 results

  1. Hello, I am getting this error message when running my script: Case $aButiD[0] To $aButiD[$iTotButtons - 1] Case ^ ERROR Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. The script's purpose is to read my ini file and create buttons for the sections and section contents. The first part of the script creates buttons for the sections of the ini, once you click on the section button it should open another set of buttons of all the contents under the section In this case, the section in the .ini file is called "TPA" on the Func flavorco() It opens the contents of "TPA" into buttons. Right now, the section it is reading is determined by $sSection. It is only when I try to change $sSection = "TPA" to $sSection = $flavorco that the error starts to appear Here is the script #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> $optbar = IniReadSectionNames("test.ini") If Not IsArray($optbar) Then Exit Local $Button[UBound($optbar) - 1] $mGUI = GUICreate('Restock Flavor Ingredients', 10 + (130 * UBound($optbar)), 100) For $x = 1 To UBound($optbar) - 1 $var = IniReadSection("test.ini", $optbar[$x]) If @error Then ContinueLoop $X_Coord = 10 + (($x - 1) * 100) $Button[$x - 1] = GUICtrlCreateButton($optbar[$x], $X_Coord, 30, 70, 30) Next GUISetState() While 1 $mMsg = GUIGetMsg() If $mMsg = $GUI_EVENT_CLOSE Then GUIDelete($mGUI) ExitLoop EndIf For $i = 0 To UBound($Button) - 1 If $mMsg = $Button[$i] Then MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & ' Pressed', 2) Global $flavorco = $Button ; sets the flavor company's variable Call('flavorco') EndIf Next WEnd Func flavorco() ;opened flavor company's flavors MsgBox(0, '$Msg = ' & $mMsg, GuiCtrlRead($Button[$i]) & $flavorco, 0) Local $sFilePath = @ScriptDir & "\Test.ini" Local $sSection = $Button Local $aArray = IniReadSection($sFilePath, $sSection) _ArrayDelete($aArray, 0) ;_ArrayDisplay($aArray) Local $iIndex Local $iTotButtons = UBound($aArray) Local $iNumPerRow = 5 Local $iButWidth = 100 Local $iButDepth = 30 Local $aButiD[$iTotButtons] Local $hGUI = GUICreate('Ingredients Stock "' & $sFilePath & '"', 10 + ($iButWidth + 10) * $iNumPerRow, _ 10 + Ceiling($iTotButtons / $iNumPerRow) * ($iButDepth + 10), -1, $WS_EX_TOPMOST) For $i = 0 To $iTotButtons - 1 ; $x = $iXBorder + (($iRectWidth + $iSpacing) * Mod($i, $iNumCols)) $x = 10 + (($iButWidth + 10) * Mod($i, $iNumPerRow)) ; $y = $iYBorder + (($iRectDepth + $iSpacing) * Int($i / $iNumCols)) $y = 10 + (($iButDepth + 10) * Int($i / $iNumPerRow)) $aButiD[$i] = GUICtrlCreateButton($aArray[$i][0], $x, $y, $iButWidth, $iButDepth) ;, $BS_NOTIFY) Next GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE GUIDelete($hGUI) ExitLoop Case $aButiD[0] To $aButiD[$iTotButtons - 1] ;clicking on a flavor name $iIndex = ($msg - $aButiD[0]) $RSINGRflavor = $aArray[$iIndex][0] ;flavor name $RSINGRml = $aArray[$iIndex][1] ; ml $RSINGRgal = $aArray[$iIndex][1]*0.000264172 ;converts ml to gal Call('openflavor') EndSwitch WEnd EndFunc Func openflavor() #Region ### START Koda GUI section ### Form=F:\Karl\AutoIt\FJ-Stock JP\GUI Forms\RSINGRSUBFORM.kxf ;opens flavor to view stock and restock submit $RSINGRSUBFORM = GUICreate($sSection & " " & $RSINGRflavor, 242, 213, 530, 269) $RSINGRFlavorTitle = GUICtrlCreateLabel($sSection & " " & $RSINGRflavor, 32, 8, 200, 28) GUICtrlSetFont(-1, 16, 800, 0, "MS Sans Serif") $RSINGRstockcaption = GUICtrlCreateLabel("Current Stock in ml:", 16, 48, 96, 17) $RSINGRstockml = GUICtrlCreateLabel($RSINGRml, 120, 48, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $RSINGRInput = GUICtrlCreateInput("ml", 40, 112, 153, 21) $RSINGRSUBMIT = GUICtrlCreateButton("SUBMIT", 16, 152, 81, 33) $RSINGRCLOSE = GUICtrlCreateButton("CLOSE", 145, 151, 81, 33) $RSINGRgalcaption = GUICtrlCreateLabel("Current Stock in gal:", 16, 80, 97, 17) $RSINGRstockgal = GUICtrlCreateLabel($RSINGRGAL, 120, 80, 114, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; $msg = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($RSINGRSUBFORM) ExitLoop Case $RSINGRCLOSE GUIDelete($RSINGRSUBFORM) ExitLoop EndSwitch WEnd EndFunc Any help is much appreciated! Thanks. My guess is that $Button isn't an actual string?? Whenever I use msgbox it shows up the string exactly, no numbers attached. So i'm not sure whats going on here.
  2. i have seen many pointing out issues related to this, i tried reading through them - still unable to solve mine.. i have a script which reads certain lines based on a search item, this is an iterative process - the ldflst_file gets updated for each iteration and the script finds the line number which has the search item. this works perfectly for few iterations, but stops in some cases abruptly with the error = Subscript used on non-accessible variable $aRead^ ERROR I have verified that the search item is present in the file. what could be the reason for this code to stop in certain cases. thanks for help my code below (partial).. full code is in attachment local $aRead=FileReadToArray($ldflst_file) global $ldflst_var1=" JOINT LOAD FORCE(X) FORCE(Y) FORCE(Z) MOMENT(X) MOMENT(Y) MOMENT(Z)" for $i= 0 to $ldflst_totlines ; ldflst_totlines is total number of lines in the file 'ldflst_file' if $aRead[$i]=$ldflst_var1 Then $ldflst_LFound=$i ExitLoop else EndIf Next nomo_new1.au3
  3. Func workSpaceSetup () ConsoleWrite ("workSpaceSetup" &@CRLF) $workSpace = WinGetHandle ("some site - Google Chrome") ConsoleWrite ($workSpace&@CRLF) $pos1 = WinGetPos ($workSpace) WinMove ($workSpace , "", $pos1[0] , $pos1[1] , 1366, 768, 0) EndFunc So the script is first, the error I get is second in the quote. This is one function of many for an app I am building but it is the first one that runs so I know there aren't other things at play here. The idea is to keep the window in the same space it is when the script runs but just resize it as this app is used across multiple computers with different screen resolutions. Could someone please elaborate upon what "Subscript used on non-accessible variable" means? Oh and the variable is declared as "Global $pos1 = 0" at the top outside of any functions with the other global variables. Any advice would be greatly appreciated! -Reiz
  4. Greetings, Func pixelHunter () Local $PixelHunt[2] Do $PixelHunt = PixelSearch (1, 1, 1016, 874, "0xCCE4CC", 0, 1, $sWorkOrderWin) Until $PixelHunt[0] > 0 EndFunc So when I call up this function in my app it fires back "Subscript used on non-accessible variable" Now, if I am understanding this message properly it is trying to tell me that the variable can't be seen by the function asking for it. I replaced "Do...Until" with simply a "ConsoleWrite" the $PixelHunt value and it doesn't throw that error. Any advice would be appreciated! -Reiz
  5. Hello, I am making a simple script to read a range of cells in a spread sheet and return the first cell's value. Global $sExcelReferencePath = "\refDoc.xls" Local $oExcel = _Excel_Open() Local $oWorkBook = _Excel_BookOpen ($oExcel, @ScriptDir&$sExcelReferencePath) Local $iRowVal = 2 Local $propArray[9] = _Excel_RangeRead ( $oWorkbook , "Sheet1", "A2:I2", 1 ) If isArray ($propArray) = 1 Then ConsoleWrite ("yay") Else ConsoleWrite ("Boo") EndIf ConsoleWrite ($propArray[0]) When I run this script , it finds the values and confirms that $propArray is an array but when I try to call $propArray[0] I get back "Array variable has incorrect number of subscripts or subscript dimension range exceeded" Any advice regarding this would be thoroughly appreciated.
  6. I can't seem to figure my way around this problem. I've posted my code below, the problem is that I wan't my auto it to read from a .Ini file a value which it then will search for, but I can't figure out how I'm supposed to type it so that it works. Local $aArray = IniReadSection(@ScriptDir & "\Gradeslist.ini", "Grades") If StringInStr($search, "" & $aArray[1][1]) ThenCan someone help me figure it out? By the way it's the second part which is not cooporating with me..
×
×
  • Create New...