Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Help with array code

Help with array code

Scheduled Pinned Locked Moved Visual Basic
game-devdata-structureshelptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Solid Snake
    wrote on last edited by
    #1

    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~

    C F 2 Replies Last reply
    0
    • S Solid 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~

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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++

      S 1 Reply Last reply
      0
      • C Christian Graus

        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++

        S Offline
        S Offline
        Solid Snake
        wrote on last edited by
        #3

        that link would be good if it was for VB6 though, but that array creation you vill have to explain some more

        C 1 Reply Last reply
        0
        • S Solid Snake

          that link would be good if it was for VB6 though, but that array creation you vill have to explain some more

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          VB6 is no longer supported, people will assume you're asking about VB.NET unless you say otherwise. VB6 is useless, I'd have to ask why your school teaches it. VB.NET 2005 Express is free, they should be using that, if you must learn VB. Christian Graus - Microsoft MVP - C++

          1 Reply Last reply
          0
          • S Solid 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~

            F Offline
            F Offline
            FrankyT
            wrote on last edited by
            #5

            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

            S 1 Reply Last reply
            0
            • F FrankyT

              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

              S Offline
              S Offline
              Solid Snake
              wrote on last edited by
              #6

              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|

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups