Furax Posted October 6, 2007 Share Posted October 6, 2007 (edited) Greetings, Thank you for looking at this. I am pretty new to scripting and there is something I cannot figure out. I have attempted to write an internet explorer bot that collects data and returns it into an array. However, the array doesn't seem to display the data when using indexes with the _ArrayDisplay function. The data is captured using string functions. Here are a few lines of code isolating the problem. $avArray[0] is not showing the letter c as expected. #include <Array.au3> #include <String.au3> Dim $avArray[2] $string = _StringBetween('welcome', 'wel','ome', -1) $avArray[0] = $string $avArray[1] = "Where is the letter c?" _ArrayDisplay($avArray, "Show me") I would see the letter c if I used the code below instead but then the array will not display the other indexes. _ArrayDisplay($avArray[0], "Show me") The code below would solve the problem but i'm hoping for an alternative as I would like to keep the clip available for other things. There has to be a better way. _ArrayToClip ($string) $avArray[0] = ClipGet() I am looking to learn Autoit and I would greatly appreciate if you could point me in the right direction or perhaps provide an explanation. I have searched the help files and the forums on many occasions but I must be missing the obvious. I do apologize for it. Thank you for your time. Edited October 6, 2007 by Furax Link to comment Share on other sites More sharing options...
BrettF Posted October 6, 2007 Share Posted October 6, 2007 You need to tell the script what dimension it is meant to be reading... #include <Array.au3> #include <String.au3> Dim $avArray[2] $string = _StringBetween('welcome', 'wel','ome', -1) $avArray[0] = $string[0] $avArray[1] = "Where is the letter c?" _ArrayDisplay($avArray, "Show me") Oh, and welcome to the forums Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Furax Posted October 6, 2007 Author Share Posted October 6, 2007 Thanks for the quick reply Bert. Now I can see a good use for StringLen! 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