Sign in to follow this  
Followers 0
personoid

Run x86 and Array problems.

5 posts in this topic

First: I have the 64 bit version of windows vista, and i want to press F5 in SciTe and have it run in x86 mode. How can i do this?

Second: I have a text file with a list of names and passwords. This is the format.

Username : Password

He is the code i'm using to make this work the way i want.

For $i = 1 To $sList
     $sLineRead = FileReadLine($sList, $i)
     $oArrayInfo = StringSplit($sLineRead, ":")
     $sUser = $oArrayInfo[0]
     $sPass = $oArrayInfo[1]

I know this is wrong, but i need to know why it's wrong and how to fix it.

Thanks,

Personoid

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How does this do on your password file ?

I'm using 3 arraydisplays for easier understanding, the first shows all the lines of the file, second shows the usernames and the third the passwords.

#Include <Array.au3>
#Include <File.au3>

Dim $accounts[1]
Dim $usernames[1]
Dim $passwords[1]

_FileReadToArray("accounts.txt",$accounts)
_ArrayDisplay($accounts,"")

For $i = 1 To $accounts[0]
    $pos = StringInStr($accounts[$i],":") 
    If $pos = 0 Then ContinueLoop   ;disregard lines that don't contain the character ":"
    _ArrayAdd($usernames, StringLeft($accounts[$i], $pos-1))
    _ArrayAdd($passwords, StringTrimLeft($accounts[$i], $pos))
Next

_ArrayDisplay($usernames,"")    
_ArrayDisplay($passwords,"")

If there are spaces before and after the ":", then change it to " : " in the StringInStr function

I tested it on this example by the way :

user1:pass1
user2:pass2
user3:pass3
comments


nothing before

user4:pass4

gggrggr

user5:pass5
Edited by Inverted

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for your help. This is nice. However, it appears my coding was fine other than a slight "!D!0T" Error.

It should have been the following:

For $i = 1 To $sList ; $sList is the equivalent of _FileCountLines(@ScriptDir & "\Info List.txt")
    $sLineRead = FileReadLine($oList, $i); It should have been $oList not $sList. $oList is FileOpen(@ScriptDir & "\Info.txt")
    $oArrayInfo = StringSplit($sLineRead, " : ", 1); Needed the 1 flag so that usenames/passwords have no extra spaces.
    $sUser = $oArrayInfo[1] ;0 would have returned the string count
    $sPass = $oArrayInfo[2] ;1 would have returned the username string.

I still need help on always running in x86 mode, though...

Edit: Ah, That came in handy. I used the following:

$pos = StringInStr($accounts[$i],":")
If $pos = 0 Then ContinueLoop   ;disregard lines that don't contain the character ":"

Though, I did edit the variables a bit.. Thanks again!

Edited by PersonoidxX

Share this post


Link to post
Share on other sites

I never laid my hands on a 64bit install (yet :) , Win7 will be 64bit)... but in the help-file there is a topic "Running the 32-bit version of AutoIt on a x64 System"... and also as far as I know there is a 32bit program files dir on 64bit machines, maybe you just have to install autoit to that dir?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I never laid my hands on a 64bit install (yet :) , Win7 will be 64bit)... but in the help-file there is a topic "Running the 32-bit version of AutoIt on a x64 System"... and also as far as I know there is a 32bit program files dir on 64bit machines, maybe you just have to install autoit to that dir?

On Install it checks to see if the user is running a 64 bit OS and prompts to install some extra features.

The helpfile says this: "You can run the x86 version of AutoIt by right-clicking a script and selecting "Run Script (x86)".

But i want to be able to run the script just by pressing F5 in SciTe, since it's a lot of trouble to hunt down a file i'm working on like this. D:

I think maybe installing without the 64 bit stuff should solve the problem... I'll try it and report back..

Edit: Yes. Installing without 64 bit components did the trick...

Edited by PersonoidxX

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