Jump to content

path not working.


 Share

Recommended Posts

the help file does not say this must be in the script directory.

output.txt is in the directory, and i get no error.. its just $aRecords[0] is only 1 and it should be 19.

this does not work....

_FileReadToArray("C:\Program Files\Diablo II\output.txt",$aRecords)

and this does

_FileReadToArray("output.txt",$aRecords)

why cant i run this with output.txt in other directories?

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

What does your output.txt contain? More than one line? How about @error? And Maybe do a FileExists() just to be sure?

Link to comment
Share on other sites

i do an @error and i dont get an error.

it detects the file, but cannot read from it.

the file is in the correct place.

it will only read an array if output.txt is in the script directory

Maybe

_FileReadToArray(""C:\Program Files\Diablo II\output.txt"",$aRecords)

that will just give a parse error

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

So your script is in the C:\Program Files\Diablo II\ location?

Dim $aArray
_FileReadToArray(FileGetShortName(@ProgramFilesDir & '\Diablo II\ouput.txt'), $aArray)
Edited by SmOke_N

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.

Link to comment
Share on other sites

So your script is in the C:\Program Files\Diablo II\ location?

Dim $aArray
_FileReadToArray(FileGetShortName(@ProgramFilesDir & '\Diablo II\ouput.txt'), $aArray)
no

whats not working, is this.

my script is in a folder on the desktop.

output.txt is in my Diablo II folder.

the script wont read that file from there.. but i also dont get any error.

the only time i get data in the array is when i dont add a path, and just add the file name, and make a copy of output.txt in my script directory.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

no

whats not working, is this.

my script is in a folder on the desktop.

output.txt is in my Diablo II folder.

the script wont read that file from there.. but i also dont get any error.

the only time i get data in the array is when i dont add a path, and just add the file name, and make a copy of output.txt in my script directory.

LOL, I bet if you remove the output.txt file from the folder your script is in, you'll get an error :lmao:

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.

Link to comment
Share on other sites

LOL, I bet if you remove the output.txt file from the folder your script is in, you'll get an error :lmao:

no... Smoke_N

it was never in the script directory to begin with, until i put it there for testing purposes.

i tried it again with the file missing from the script directory. no error.

$aRecoreds[0] is 1 if the file was not there it would be 0.. or i would get the error.

$aRecords[1] is blank.. no data.. ""

i get rid of the path, and place the output.txt on in my script directory.

everything works.

$aRecoreds[0] is 19

and the array is full of data.

have you tried this?????

it simply will not return data from a file that is not in the same directory as the script.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

does anyone else have trouble when using a path other than the script directory?

#include <file.au3>
dim $aRecords
$d2dir = RegRead("HKEY_CURRENT_USER\Software\Blizzard Entertainment\Diablo II", "InstallPath")

If Not _FileReadToArray($d2dir & "\output.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
MsgBox(0,"test",$aRecords[0])
For $x = 1 to $aRecords[0]
    Msgbox(0,'Record:' & $x, $aRecords[$x])
Next

the path is correct, the file exists. because this messagebox never appears.

MsgBox(4096,"Error", " Error reading log to Array    error:" & @error)

the only time it reads the entire file into an array is when i remove the path, and move the file "output.txt" into the scripts directory.

If Not _FileReadToArray("output.txt",$aRecords) Then

im not getting any errors, and I seem to have isolated the problem. so I have to think its possibly something wrong with autoit?

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

Are you suggesting he should run a search command all over his computer to make sure to get the proper path to output.txt? :lmao:

No, and if you really meant that question then you should read the thread before responding. He said that the script was not in the Diablo II folder, which suggest he had an output.txt in his script directory, or else it would have thrown an error. In this case, it's a careless mistake on his part, and the return he was getting "1" was the true return. Otherwise "output.txt" if what he says is true (not in the Diablo II folder) would not work at all, plain and simple.

Also, he's asked if anyone else experiences this, which goes to show his lack of knowledge and or respect to the product at hand. Meaning that if he cared enough to give "decent" information, then 90% of the questions in this thread would not have to be asked. I don't even think he ever stated what version of autoit he was using, to narrow down or even test his situation. That's a bit rediculous in itself considering how many of us use different versions.

Edited by SmOke_N

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.

Link to comment
Share on other sites

  • Moderators

@toddie... Do you EVER debug anything?

Either provide the entire script or a working example that throws the error, or debug it yourself, you've given nothing other than 1 line of code that I verify Works (With my autoit versions... I could tell you what they were, but what's the sense?)

You're posts are classic noob posts, they go something like... this is a problem, ... [wind is blowing waiting for the rest], no re-creation, no explination other than something is here, and there but it doesn't work.

Success returns 1 or an Array... plain and simple.

#include <array.au3>
#include <file.au3>
Dim $array
_FileReadToArray(@ProgramFilesDir & '\Diablo II\output.txt', $array)
_ArrayDisplay($array, 'Output')
Those 5 lines of "working" code are more than you've provided.

Not to hard is it.

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.

Link to comment
Share on other sites

my last post was more than one line of code.

only a noob.. calls someone a noob.

AutoIt Version: 3.1.1.0

i think i found the problem.

the file is being created, and then read, but possibly read before data has entered the file.

i tried that last code i provided in a script by itself.. without the rest of the script... whjere its actually creating the file...

and it works fine.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Moderators

my last post was more than one line of code.

only a noob.. calls someone a noob.

AutoIt Version: 3.1.1.0

i think i found the problem.

the file is being created, and then read, but possibly read before data has entered the file.

i tried that last code i provided in a script by itself.. without the rest of the script... whjere its actually creating the file...

and it works fine.

What is it with you morons and not reading?

Exactly where did I call you a noob? Re-read that line again.

3.1.1.0? You need to catch up with the rest of us and at least use the current release if you are ever going to ask for support.

Glad you were finally able to figure it out on your own.

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.

Link to comment
Share on other sites

  • Moderators

:lmao:

I wasn't referring to him being a noob... just the style, I guess I can see where that was taken out of context (since there wasn't any).

A noob to me is someone that is just starting.... After 4 yrs, and threads like this, then you move to a different sub class I suppose.

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.

Link to comment
Share on other sites

only a noob.. calls someone a noob.

It can be scientifically proven that you are a noob.

Since the definition of your rule is such that anybody calling somebody else a noob is in turn a noob them self, we can hypothesize that you are calling people a noob in advance of their noob-calling. As a result, any future noob calling is already met with the assertion that the caller is a noob. However, since you have made this assertion before any noob calling has occurred, you have called the entire world a noob well in advance of any real noob calling. And if we hold true to your rule that anybody calling somebody else is a noob and we know that you have called everybody a noob based on their potential, you are a noob several billion times over, once for each person on the planet you have pre-called a noob.

Edit: Fixed a couple typos.

Edited by Valik
Link to comment
Share on other sites

  • Moderators

:lmao:

lmfao!

The word "noob" bugs me. Especially when you hear mature adults say it.

:ph34r: Which of the 3 are you referring to when you say "mature"?

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.

Link to comment
Share on other sites

:lmao: Which of the 3 are you referring to when you say "mature"?

I was'nt implying that towards any of you guys. I just find it really childish for an adult, or anyone for that matter, to call someone a "noob". Its a dumb word, and really irritates me. Edited by CHRIS95219
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...