Jump to content

Using Assigned Variables


Recommended Posts

Hello!

I havent found any solution for my problem in the Internet or on the Forum, excuse me If i overlooked something.

For $i = 1 To 5
  Assign("oGoogle"&$i, _IECreate("google.com" 0, 1, 0, 0))
  $GoogleVar = $oGoogle&$i
  Assign("oSearchInput"&$i, _IEGetObjById($GoogleVar, "lst-ib"))
Next

What I'am trying to do is open Google.com 5 times with _IECreate and assign it to the Variables "$oGoogle1, $oGoogle2,...", but I have to use these Variables again, because I want to assign the Searchinputs from every $oGoogle to another Variable ($oSearchInput1, $oSearchInput2,...). But if i try to use this code, Autoit tells me that $oGoogle is not declared!

I hope someone is willing to help me! :) (Excuse my Grammar :sweating:)

Edited by WannaBeGut
Little Correction
Link to comment
Share on other sites

I don't know why I hate Assign+eval. (and don't understand why autoit create/use/implement/keep etc.)

 

Saludos 

Link to comment
Share on other sites

  • Developers

I don't know why I hate Assign+eval. (and don't understand why autoit create/use/implement/keep etc.)

Learning to program is also taking a step at a time. Arrays will come when the OP in really interested as a (better) alternative. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You may be right Jos but I find that Assign + Eval  + related pitfalls is much, much harder to manage than understanding how a speadsheet works, either single column (1D array) or multiple columns (2D array). Most people are used to sheet;column;row and that is dramatically similar to array[row][column].

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

  • Developers

Understood, but just worked on the OP's current line of thinking and pursued to get that cleared up first without changing too much.
I am not stopping any of you to chime in here and show the OP a better alternative. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I don't know why I hate Assign+eval. (and don't understand why autoit create/use/implement/keep etc.)

I think it's especially useful because you can create your own syntax (plus interpreter) and run the code with an undefined number of variables assigned on the fly. That's freakin' awesome IMO! :D

Link to comment
Share on other sites

Certainly, but I wouldn't call such use "recommended path for new users of AutoIt/scripting/programming".

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

@czardas maybe you are right. but I never used them before and I'm sure I'll not use them.

When I saw them on help file. I was hearing some low voice. it was Autoit whispering don't use them please. lol

Saludos

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

×
×
  • Create New...