elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Curso de javascript por TickTack


  Mostrar Temas
Páginas: [1]
1  Programación / .NET (C#, VB.NET, ASP) / Array vb.net 2010 en: 29 Marzo 2015, 07:28 am
Hola.
tengo un problema con arrays en vb.net, tengo 12 array que contendrán distintos datos que luego escribo en un archivo xml, el problema es que no todos los arrays contendrán datos o no todos tendrán el mismo número de datos y eso me genera problemas.

lo que necesito o quisiera hacer es llenar de ceros los que tengan menos datos e igual con los que no tengan ningún dato.

lo que tengo hasta el memento es lo siguiente:

Código
  1. Do While tmp1 <= var1.Length
  2.            If var2(tmp1) = Nothing Then
  3.                var2(tmp1) = 0
  4.            End If
  5.            If var3(tmp1) = Nothing Then
  6.                var3(tmp1) = 0
  7.            End If
  8.            If var4(tmp1) = Nothing Then
  9.                var4(tmp1) = 0
  10.            End If
  11.            If var5(tmp1) = Nothing Then
  12.                var5(tmp1) = 0
  13.            End If
  14.            If var6(tmp1) = Nothing Then
  15.                var6(tmp1) = 0
  16.            End If
  17.            If var7(tmp1) = Nothing Then
  18.                var7(tmp1) = 0
  19.            End If
  20.            If var8(tmp1) = Nothing Then
  21.                var8(tmp1) = 0
  22.            End If
  23.            If var9(tmp1) = Nothing Then
  24.                var9(tmp1) = 0
  25.            End If
  26.            If var10(tmp1) = Nothing Then
  27.                var10(tmp1) = 0
  28.            End If
  29.            If var11(tmp1) = Nothing Then
  30.                var11(tmp1) = 0
  31.            End If
  32.            If var12(tmp1) = Nothing Then
  33.                var12(tmp1) = 0
  34.            End If
  35.            tmp1 += 1
  36.        Loop
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines