Autor Tema: Help to convert some Javascript code to vb6  (Leído 3375 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Gianni

  • Bytes
  • *
  • Mensajes: 28
  • Reputación: +0/-0
    • Ver Perfil
Help to convert some Javascript code to vb6
« en: Noviembre 06, 2013, 08:52:16 am »
Hi
I need to convert this line of Javascript code in vb6:

poly.latitude.length is an array of single value

Código: [Seleccionar]
for(var c = false, i = -1, l = poly.latitude.length, j = l - 1; ++i < l; j = i)
How implement for next cycle?
Código: [Seleccionar]
i=-1
l=Ubound(array)
j=l-1
For i = -1 to l
'Some stuff
j=i
next i

is this correct?
« última modificación: Noviembre 06, 2013, 12:04:20 pm por Gianni »

Jeronimo

  • Gigabyte
  • ****
  • Mensajes: 402
  • Reputación: +33/-2
    • Ver Perfil
Re:Help to convert single line of Javascript code to vb6
« Respuesta #1 en: Noviembre 06, 2013, 09:41:22 am »
Hi.
I don't know if it does exactly what the javascript line does. What about "c = False"?
Anyway, I would do it like this:
Código: (VB) [Seleccionar]
l = Ubound(array)
For i = -1 to l
'Some stuff
j = i
Next i

Código: [Seleccionar]
i=-1
Why this? It is not necessary.

Código: [Seleccionar]
j=l-1
Why this? You don't use j until you do j = i.

Código: [Seleccionar]
j=i
Why this? You don't use j anywhere else.

Maybe there is some more code you did not provide.

Gianni

  • Bytes
  • *
  • Mensajes: 28
  • Reputación: +0/-0
    • Ver Perfil
Re:Help to convert some Javascript code to vb6
« Respuesta #2 en: Noviembre 07, 2013, 11:38:26 am »
Thanks I have resolved