Set 2d array values in visualbasic

Discussion in 'Scripting' started by stevemk14ebr, Jun 14, 2011.

  1. stevemk14ebr

    stevemk14ebr MDL Senior Member

    Jun 23, 2010
    267
    48
    10
    #1 stevemk14ebr, Jun 14, 2011
    Last edited: Jun 15, 2011
    I was wondering if it would be possible to set the values of an array :" Dim board(673, 454) As Integer"
    i want to save every point as = to 1; for example "board(45,1) = 1"
    but i dont want to have to type 673 points and = to 1 so MY QUESTION IS HOW DO I SET ALL POINTS IN MY ARRAY AS = TO 1 WITHOUT TYPING 673 POINTS IN VISUALBASIC LIKE IN SOME TYPE OF LOOP

    need help A.S.A.P been working on this for 3 days and cant get it working
     
  2. stevemk14ebr

    stevemk14ebr MDL Senior Member

    Jun 23, 2010
    267
    48
    10
    *thanks for the help had to go to yahoo answers* here's the solution
    code:
    For loop1 = 0 To 672
    For loop2 = 0 To 453
    board(loop1, loop2) = 1
    Next
    Next
    :Lighten:
     
  3. djpc47@gmail.com

    djpc47@gmail.com MDL Novice

    Nov 19, 2009
    38
    5
    0
    I was about to reply I don't think you can do arrays on batch files but then I realized that you were talking about vb...... as for vb I've only ever toyed with vb6; my tip is if it still exists try looking into and/or try to get a hold of MSDN library (whatever month+year suites the version of vb your using) I use to find it really nice for simple and small problems....