moonglow Posted February 27, 2006 Share Posted February 27, 2006 Hi there, I'm new to this forum, so I'll shortly introduce myself :-) I'm working a a software packager for a company in Germany and sometimes we can't get some products installed silently, thats where AutoIt comes in :-) What can I say, AutoIt rules! I now try go make my life a bit easier to write a small tool to automate some of our processes. Ok, now for the obvious, my question :-) Here is what I want to do: Construct a call to create a GUI object, it works fine as long as the object i want to eval() is no array. To make it a bit more clear: The following works well if: $aInput[$i][$field] = $something It does not work if: $aInput[$i][$field] = $something[1] $result = assign($aInput[$i][$field] & '_' & $i,GUICtrlCreateInput(eval(StringRight($aInput[$i][$text],StringLen($aInput[$i][$text])-1)), .....) I don't understand where the difference is for the funtion eval(), if it's a plain variable or a array variable. Has somebody any clue how to get around this (maybe there is an additional function I haven't found yet)? Thanx a lot in advance, Greetings from Germany Link to comment Share on other sites More sharing options...
seandisanti Posted February 27, 2006 Share Posted February 27, 2006 Hi there, I'm new to this forum, so I'll shortly introduce myself :-) I'm working a a software packager for a company in Germany and sometimes we can't get some products installed silently, thats where AutoIt comes in :-) What can I say, AutoIt rules! I now try go make my life a bit easier to write a small tool to automate some of our processes. Ok, now for the obvious, my question :-) Here is what I want to do: Construct a call to create a GUI object, it works fine as long as the object i want to eval() is no array. To make it a bit more clear: The following works well if: $aInput[$i][$field] = $something It does not work if: $aInput[$i][$field] = $something[1] $result = assign($aInput[$i][$field] & '_' & $i,GUICtrlCreateInput(eval(StringRight($aInput[$i][$text],StringLen($aInput[$i][$text])-1)), .....) I don't understand where the difference is for the funtion eval(), if it's a plain variable or a array variable. Has somebody any clue how to get around this (maybe there is an additional function I haven't found yet)? Thanx a lot in advance, Greetings from Germanyboth of your examples looks like they should work, but that would be making some assumptions. could you include your whole script,, or atleast the part where $something[1] is assigned a value? Link to comment Share on other sites More sharing options...
moonglow Posted February 27, 2006 Author Share Posted February 27, 2006 both of your examples looks like they should work, but that would be making some assumptions. could you include your whole script,, or atleast the part where $something[1] is assigned a value? Thanks for your response, you could really assign any value to the variable: example: working: $something = "whats up" not working: Dim $something[1] $something[0] = "whats up now" The only difference is that eval() will work on an array in the second example, and that ends up with a blank string instead of "whats up now". It also returns @error 1 Link to comment Share on other sites More sharing options...
seandisanti Posted February 27, 2006 Share Posted February 27, 2006 Thanks for your response, you could really assign any value to the variable: example: working: $something = "whats up" not working: Dim $something[1] $something[0] = "whats up now" The only difference is that eval() will work on an array in the second example, and that ends up with a blank string instead of "whats up now". It also returns @error 1why do you need to use eval? i'm going to try to recreate your error over here and see what i can't figure out. Link to comment Share on other sites More sharing options...
moonglow Posted February 28, 2006 Author Share Posted February 28, 2006 why do you need to use eval? i'm going to try to recreate your error over here and see what i can't figure out. O.k. to make myself a bit more clear, I have cleaned up the small test prog a bit and will attach it to my posting. You will see that I want to read some descriptions and values out of arrays to be able to create a variable number of lines in the GUI and I didn't find any other way to do it. If you look at it, please bear in mind that it still is very incomplete, I use this part for quick checks before it makes it's way into my main prog arraytest1.zip Link to comment Share on other sites More sharing options...
test12 Posted March 3, 2006 Share Posted March 3, 2006 Thanks for your response, you could really assign any value to the variable: example: working: $something = "whats up" not working: Dim $something[1] $something[0] = "whats up now" The only difference is that eval() will work on an array in the second example, and that ends up with a blank string instead of "whats up now". It also returns @error 1 $something[0] contains the number of elements in the array, you can't use [0]. Link to comment Share on other sites More sharing options...
nfwu Posted March 3, 2006 Share Posted March 3, 2006 I recommend you tidy-up your script a little and look through it again. I find that when ever something does not work, i tidy it up, then look through it line by line, in order of execution, and usually find what i am doing wrong. Hope this helps... #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() 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