Jump to content

Redim


Recommended Posts

I have the following code sitting in a While loop, is there a reason that it is not seeing $i on in the ReDim 
Func getPhoneList(ByRef $s)
   Local $type, $primary, $int, $areaCode, $first3, $last4 , $ext, $finialArray[100], $localArray[100],$i = 0 , $lastString
   while 1 

;Lots of work and clicking and fun cool stuff

If $phoneString == $lastString    Then;
         Redim $finialArray($i + 1)
         $s = _ArrayToString($finialArray, "|||")
         Send("{ESC}")
         Send("{RIGHT}")
         Send("{ENTER}")
         return $s
     else
         $lastString = $phoneString
         $finialArray[$i] = $phoneString
         $i = $i + 1
         Send("{DOWN}")
         Send("{SPACE}")
         Send("{TAB}")
         Send("{TAB}")
         Send("{ENTER}")
     EndIf ;==> Go back to top of while loop

The Error it is giving

(512) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.:
ReDim $finialArray($i + 1)
ReDim $finialArray^ ERROR
Edited by USMCGalloway
Link to comment
Share on other sites

Why are you ReDimming the array in the first place? You're redimming it in the part of the If statement that isn't adding anything to it, but you're not redimming it in the section that does. Seems like you're doing it backwards.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I am just creating an array that I know is to large for the data I need to add to it. 

First I am checking if the string is the same value as the last time (meaning I am at the bottom of the list) it ran the loop, if it is then I ReDim the large array, and turn the array into a string which will at some point be passed to Java. 

If it does not match( I am not at the bottom of the list) it takes the string that it just created of the data it collected, puts it in the array , and updates lastString. I think it does what I want it to do,  :sweating:

You were right FireFox, I was just going off an example I seen posted on some where else on here. Wont do that again  o:)

Link to comment
Share on other sites

USMCGalloway,

If you are trying to scrape phone numbers from a Web site / app that code will NOT do that, even assuming that you get the syntax / logic correct.  I might be more helpful if you described at a higher level what you want to do.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

I am clicking though a database that is running off of Citrix, when I get to the correct screen, I am running though assigning fields to specific variables. The above function is being used in a getFunction.

Once it makes one run through the selected data, I form it into a large string, with two sets of delimiters, one to separate key words from data, and then another to separate the pairs from one another, and in some cases I have another delimiter to separate   the data sets, which will be sent away to a program that is calling the scripts. 

And see above for the rest. 

Its doing what I want it to do, by if someone has a better, more stable way to do this I am all ears. 

The main problem I am having is with server lag spikes from Citrix, my code is filled with pixelSerches to makes sure screens are loaded, and fields are updating .... 

Link to comment
Share on other sites

USMCGalloway,

Thanks for the explanation. As stated in an earlier thread, it would make life a hell of a lot simpler if you could get read access to the DB ( or copy of the DB).

Good Luck,

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Yea, it would be, but with what I am dealing with there are rules against it, all I have the ability to do is to access, and edit some of the data, yet we can not save any of the data to the local machines. I'm sure I will have more dumb questions down the road, as I think I am going to be using Autoit for a long time. 

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...