nht3004 Posted May 5, 2009 Share Posted May 5, 2009 (edited) How can I start an array without the size of that?Global key[3];Key[1]="Hello";Key[2]="Hi";The red one is the one I want to skip!And how can I get array size for For...To...Step...Next work?ExampleFor $i=0 To sizeOfArrayThatIUsedToUse$Array[0] Step 1Next Edited May 5, 2009 by nht3004 for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
LurchMan Posted May 5, 2009 Share Posted May 5, 2009 (edited) How can I start an array without the size of that? Global key[3]; Key[1]="Hello"; Key[2]="Hi"; The red one is the one I want to skip! Global Key Then define what each dimension of the array is or use some UDF or something that returns an array...always works for me, dunno if thats the way your suppose to do it though. and for array size: For $n = 0 To UBound($Array) - 1 ;do something Next Edited May 5, 2009 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
nht3004 Posted May 5, 2009 Author Share Posted May 5, 2009 Global Key Then define what each dimension of the array is or use some UDF or something that returns an array...always works for me, dunno if thats the way your suppose to do it though.I dont' get what you mean , could u show me details? Thanks! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
LurchMan Posted May 5, 2009 Share Posted May 5, 2009 read this: ArraysThen look in the help file about _FileListToArray() those 2 things will help you Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
nht3004 Posted May 5, 2009 Author Share Posted May 5, 2009 Global Key Then define what each dimension of the array is or use some UDF or something that returns an array...always works for me, dunno if thats the way your suppose to do it though. and for array size: For $n = 0 To UBound($Array) - 1 ;do something NextI do like what you tell me UBound() and here is what I get! Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
LurchMan Posted May 5, 2009 Share Posted May 5, 2009 (edited) that means you dont have it declared correctly...if your are hard coding each dimension of the array then u have to declare the size of the array. ex: Global $array[2] $array[0] = "something" $array[1] = "else" If you are using a UDF to get the array then you can just delcare the variable ex: Global $array $array = _FileListToArray($sPath) Edited May 5, 2009 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 5, 2009 Share Posted May 5, 2009 if you AREN'T resizing the array.. For $i = 0 to 2 do this next [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
LurchMan Posted May 5, 2009 Share Posted May 5, 2009 if you AREN'T resizing the array..For $i = 0 to 2do thisnextthis works also...im just used to having everything in a variable and i never really know how big the array is at any given time... Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
nht3004 Posted May 5, 2009 Author Share Posted May 5, 2009 Finally, I use this $keyString="sID|sPass"; $key=StringSplit($keyString,"|"); For $i=0 To $key[0] do..... Next for(loop=0; loop<infinity; loop++) { alert('I love you'); } 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