deef99 Posted January 14, 2010 Share Posted January 14, 2010 Can anyone please tell me what this means or where to look to fix it?C:\Program Files\AutoIt3\Examples\Filet6.au3 (22) : ==> Subscript used with non-Array variable.Here's a snippet of the script...line 22 is in RED. I've been trying alot of things...I just don't understand arrays I guess. I would of done this reading line by line [files are all 40 lines], but the HELP said don't do it that way [read line and increment by 1]. How to you retrieve a line in an array and read a part of it? Any help would be appreciated!#include<File.au3>#include "array.au3"#include "Date.au3"#include "String.au3"Global $arrayGlobal $sFile;Global $al ;array lineGlobal $s0 ;skill 400 levelGlobal $s1 ;skill 401 levelGlobal $s3 ;skill 403 levelGlobal $agt ;701 or 702 ard or cov agentdim $aRecordsGlobal $vrec$al = 5$read = _FileReadToArray("c:\temp\tt.text", $array)$filenew = FileOpen("c:\temp\tnew.txt", 0)$al = 5;For $al = 5 to $aRecords[0]While $al <> $aRecords[0] $vrec = _ArrayToString($array, @TAB, $al, $al) MsgBox(0, "al", $al&" "&$aRecords) If StringRight($vrec, 3) = "400" Then $al = $al + 1 $s0 = StringRight($vrec, 3) EndifI also used to have this, but it gave me the same error on the first line below:If stringRight($array[$al],3) = "400" Then $al = $al+1 $s0 = stringRight($array[$al],1) FileWriteLine($filenew,"SetArr(2,2)= " & $s0)Endif Link to comment Share on other sites More sharing options...
enaiman Posted January 14, 2010 Share Posted January 14, 2010 $aRecords is not an array. You get that error when you try to use an array element which doesn't exist. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now