Help with array code
-
Hello everyone. i posted before abot making a sudodu game generator and was given the answer that i need an array for that. i would really apriciate if i could get some help with coding this array since this litte program is due Week 16 and my teacher is to senile to help me... also i need to shed some light in how to generate blanks in a randomize code with only numbers. i am not posting my code here because it is very long... but i could send it to people who would like to help me. Thanks in advance ~Snake~
-
Hello everyone. i posted before abot making a sudodu game generator and was given the answer that i need an array for that. i would really apriciate if i could get some help with coding this array since this litte program is due Week 16 and my teacher is to senile to help me... also i need to shed some light in how to generate blanks in a randomize code with only numbers. i am not posting my code here because it is very long... but i could send it to people who would like to help me. Thanks in advance ~Snake~
An array is created like this: dim ints as int() = new int(20) http://www.google.com.au/search?hl=en&q=vb.net+array&meta=[^] lots of links there Your only real option is to set a 'magic' number to equal nothing, -1 and 0 are commonly used for this. Christian Graus - Microsoft MVP - C++
-
An array is created like this: dim ints as int() = new int(20) http://www.google.com.au/search?hl=en&q=vb.net+array&meta=[^] lots of links there Your only real option is to set a 'magic' number to equal nothing, -1 and 0 are commonly used for this. Christian Graus - Microsoft MVP - C++
that link would be good if it was for VB6 though, but that array creation you vill have to explain some more
-
that link would be good if it was for VB6 though, but that array creation you vill have to explain some more
-
Hello everyone. i posted before abot making a sudodu game generator and was given the answer that i need an array for that. i would really apriciate if i could get some help with coding this array since this litte program is due Week 16 and my teacher is to senile to help me... also i need to shed some light in how to generate blanks in a randomize code with only numbers. i am not posting my code here because it is very long... but i could send it to people who would like to help me. Thanks in advance ~Snake~
ok here: Dim i() As Integer 'create a array of ints with 0 length For j As Integer = 0 To 1000000000 ReDim Preserve i(j) ' redefine the array in memory, keeping the existing values i(j) = j Next return i advice: 1) everything is reference in VB (except integral primatives like ints ) 2) arrays are declared to have a lengthh adn don't like it when their boundries are broken 3) mixing .count and .length lead to trying to remember which is "0 based" and which is "1 based" 4) if you get an indexOutOfRange violation check your iterators 5) redim is your friend 6) collections are often a better choice 7) avoid mixing collections and arrays (collections are 1 based and always have >= 1 member) 8) use for each when ever applicable (another reason to avoid mixing arrays with collections) this really should all be in your textbook. Look it up... good luck hey...slang is the vernacular for the vernacular...wow
-
ok here: Dim i() As Integer 'create a array of ints with 0 length For j As Integer = 0 To 1000000000 ReDim Preserve i(j) ' redefine the array in memory, keeping the existing values i(j) = j Next return i advice: 1) everything is reference in VB (except integral primatives like ints ) 2) arrays are declared to have a lengthh adn don't like it when their boundries are broken 3) mixing .count and .length lead to trying to remember which is "0 based" and which is "1 based" 4) if you get an indexOutOfRange violation check your iterators 5) redim is your friend 6) collections are often a better choice 7) avoid mixing collections and arrays (collections are 1 based and always have >= 1 member) 8) use for each when ever applicable (another reason to avoid mixing arrays with collections) this really should all be in your textbook. Look it up... good luck hey...slang is the vernacular for the vernacular...wow
thank you, i will try some of this code ASAP ^^ :-D and yes i agree, VB6 is old but i guess its all about the license stuff >_> X|