MariusN Posted December 20, 2009 Posted December 20, 2009 (edited) Lets say i have 100 Variables ie $line1, $line2, $line3 up to $line100...Is there a way that i can add a ARRAY in the GLOBAL area ie $array = $line[0] to $line [99] ? Something like that so i dont need to enter 100 x $line(whatever) tia Edited December 20, 2009 by MariusN
enaiman Posted December 20, 2009 Posted December 20, 2009 If you ended up with 100 variables like $line1, $line2 ... that is a bad code practice.What you ask for is not very easy done; you need to read about Assign and Eval ... enough to say that it takes you less time to create an array from the begining ($line[0], $line[1] ...) than fixing the current code. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
KaFu Posted December 20, 2009 Posted December 20, 2009 Or something more simple??? Like this: Global $array[100] for $i = 0 to 99 $line[$i] = "Value" next OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
MariusN Posted December 21, 2009 Author Posted December 21, 2009 If you ended up with 100 variables like $line1, $line2 ... that is a bad code practice. What you ask for is not very easy done; you need to read about Assign and Eval ... enough to say that it takes you less time to create an array from the begining ($line[0], $line[1] ...) than fixing the current code. Have a heart...I'm not a "fundi" like you guys, but trying to be at the end. I guess we all have to start somewhere, right?
MariusN Posted December 21, 2009 Author Posted December 21, 2009 As mentioned before, i admit being a total NOob when it comes to arrays. Anyone here knows a geniune GENIUNE good tutorial on arrays? Al my coding i've done in the past i have tried to "bypass" arrays, but i think at the end, it'll make my programming MUCH easier... Thanks guys..
KaFu Posted December 21, 2009 Posted December 21, 2009 Kannst du Deutsch? http://www.bug-fix.info/array_tut.htm Otherwhise try this http://translate.google.de/translate?u=http%3A%2F%2Fwww.bug-fix.info%2Farray_tut.htm&sl=de&tl=en&hl=&ie=UTF-8 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
AdmiralAlkex Posted December 21, 2009 Posted December 21, 2009 As mentioned before, i admit being a total NOob when it comes to arrays.Anyone here knows a geniune GENIUNE good tutorial on arrays? Al my coding i've done in the past i have tried to "bypass" arrays, but i think at the end, it'll make my programming MUCH easier...Thanks guys..There's a tutorial on arrays in the Wiki. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
MariusN Posted December 21, 2009 Author Posted December 21, 2009 (edited) Last question...Am i wrong if i say that you hardly use arrays in compiling utilities, and that arrays are more to do with Databases AND Calculations? or is it just a personal preference type of thing... just out of curiosity Edited December 21, 2009 by MariusN
MariusN Posted December 22, 2009 Author Posted December 22, 2009 Last question...Am i wrong if i say that you hardly use arrays in compiling utilities, and that arrays are more to do with Databases AND Calculations?or is it just a personal preference type of thing...just out of curiosityHey guys...I'm feeling so "chuffed" about myself as i have just figured it out...DAMN!!
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