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

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Temas
Páginas: [1]
1  Programación / Java / Arrays en: 4 Mayo 2014, 12:49 pm
Buenas tardes

Tengo este código en VBS y necesito pasarlo a Java
He intentado varias soluciones para poder realizar Redim y Redim Preserve, pero no me ha funcionado ninguna
Alguien me presta una ayuda
Muchas gracias por adelantado

Dim cControls
set cControls = New controles

 ' As long as there are entries in the recordset
   NumFilas = 0
   Do While iStatus = 0
              'Joan 15/05/2007 Quito todos los resume Next
      'On Error Resume Next      
      If NumFilas = 0 then
         NumFilas = 1
         Redim cControls (NumFilas)
         'NumFilas = UBound(cControls,1)
      Else
         NumFilas = NumFilas + 1
         Redim Preserve cControls (NumFilas)
         NumFilas = UBound(cControls,1)
      End if
      Set cControls(NumFilas) = new controles

      ' Get the Fieldname
      cControls(NumFilas).ITEM_NAME = oRes.Fields("v_nomitem")
      ' Get the type of the mergefield
      cControls(NumFilas).ITEM_TYPE = oRes.Fields("v_type")
      ' Get the name of the mergefield
      cControls(NumFilas).ITEM_LABEL = oRes.Fields("v_label")
      cControls(NumFilas).ITEM_CODETABLE = oRes.Fields("v_codetable")
      cControls(NumFilas).ITEM_CODEFELD = oRes.Fields("v_codefeld")   
      iStatus = oRes.readnext
   Loop
2  Programación / Java / Problema con Arrays en: 4 Mayo 2014, 02:02 am
Buenas
Soy completamente novato en java

Tengo este código en VBS y necesito pasarlo a Java
He intentado varias soluciones para poder realizar Redim y Redim Preserve, pero no me ha funcionado ninguna, no lo debo haber realizado bien.  ;D
Alguien me presta una ayuda
Muchas gracias por adelantado

Código
  1. Dim cControls
  2. set cControls = New controles
  3.  
  4. ' As long as there are entries in the recordset
  5. NumFilas = 0
  6. Do While iStatus = 0
  7.         'Joan 15/05/2007 Quito todos los resume Next
  8. 'On Error Resume Next
  9. If NumFilas = 0 then
  10. NumFilas = 1
  11. Redim cControls (NumFilas)
  12. 'NumFilas = UBound(cControls,1)
  13. Else
  14. NumFilas = NumFilas + 1
  15. Redim Preserve cControls (NumFilas)
  16. NumFilas = UBound(cControls,1)
  17. End if
  18. Set cControls(NumFilas) = new controles
  19.  
  20. ' Get the Fieldname
  21. cControls(NumFilas).ITEM_NAME = oRes.Fields("v_nomitem")
  22. ' Get the type of the mergefield
  23. cControls(NumFilas).ITEM_TYPE = oRes.Fields("v_type")
  24. ' Get the name of the mergefield
  25. cControls(NumFilas).ITEM_LABEL = oRes.Fields("v_label")
  26. cControls(NumFilas).ITEM_CODETABLE = oRes.Fields("v_codetable")
  27. cControls(NumFilas).ITEM_CODEFELD = oRes.Fields("v_codefeld")
  28. iStatus = oRes.readnext
  29. Loop
  30.  
  31.  

[MOD] Para publicar codigo, usa etiquetas GeShi, Gracias.
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines