Sign in to follow this  
Followers 0
Paradox

Array's...

4 posts in this topic

Holy crap do they have me doing a lot of coding lately.

Anyways, here's the issue... I must be stupid with arrays or something, but I swear, I'm reading through the help file and all and I'm following it exactly (as far as I can tell), however, when I run my script, I get an error stating that a "Subscript used with Non-Array variable".

HELP!!!!!

#include <file.au3>
#include <array.au3>

; Application Start, input path and filename of file to modify, read in category section

$path = InputBox("BDS file to convert", "Please enter the full path and filename of the BDS file to convert :", "")

$file2read = fileopen($path, 0)

$OriginalCatagory = inireadsection($file2read, "category")

for $i = 1 to $OriginalCatagory[0][0]
    MsgBox(4096, "", "Key: " & $OriginalCatagory[$i][0] & @CRLF & "Value: " & $OriginalCatagory[$i][1])
Next

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Holy crap do they have me doing a lot of coding lately.

Anyways, here's the issue... I must be stupid with arrays or something, but I swear, I'm reading through the help file and all and I'm following it exactly (as far as I can tell), however, when I run my script, I get an error stating that a "Subscript used with Non-Array variable".

HELP!!!!!

#include <file.au3>
#include <array.au3>

; Application Start, input path and filename of file to modify, read in category section

$path = InputBox("BDS file to convert", "Please enter the full path and filename of the BDS file to convert :", "")

$file2read = fileopen($path, 0)

$OriginalCatagory = inireadsection($file2read, "category")

for $i = 1 to $OriginalCatagory[0][0]
    MsgBox(4096, "", "Key: " & $OriginalCatagory[$i][0] & @CRLF & "Value: " & $OriginalCatagory[$i][1])
Next
$OriginalCatagory = inireadsection($path, "category")
for $i = 1 to $OriginalCatagory[0][0]
    MsgBox(4096, "", "Key: " & $OriginalCatagory[$i][0] & @CRLF & "Value: " & $OriginalCatagory[$i][1])
Next

Edit:

Guess I should explain myself... (I'm so tired, I just posted and left ... sorry)... You need a path to the ini, the variable you have $file2read is the handle returned back from FileOpen(), the only thing you'll need to use that for is FileClose($file2read).

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

$OriginalCatagory = inireadsection($path, "category")
for $i = 1 to $OriginalCatagory[0][0]
    MsgBox(4096, "", "Key: " & $OriginalCatagory[$i][0] & @CRLF & "Value: " & $OriginalCatagory[$i][1])
Next

Edit:

Guess I should explain myself... (I'm so tired, I just posted and left ... sorry)... You need a path to the ini, the variable you have $file2read is the handle returned back from FileOpen(), the only thing you'll need to use that for is FileClose($file2read).

OMFG you have got to be kidding me... Thanks... I feel like an idiot now... :lmao:

Share this post


Link to post
Share on other sites

OMFG you have got to be kidding me... Thanks... I feel like an idiot now... ;)

No worries :lmao: , I do it all the time when I'm not paying attention, or thinking 10 steps ahead of what I'm doing at the moment.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0