Jump to content

Subscript used with non-Array variable What???


deef99
 Share

Recommended Posts

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 $array

Global $sFile

;Global $al ;array line

Global $s0 ;skill 400 level

Global $s1 ;skill 401 level

Global $s3 ;skill 403 level

Global $agt ;701 or 702 ard or cov agent

dim $aRecords

Global $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)

Endif

I 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...