Erel must have a look at this.
This line is supposed to be wrong
If cadena_temporal.Length >= maximo_caracteres Then
changing the line, for checking, to this works:
If i >= 6 Then
It seems that there is something strange with
cadena_temporal.Length >= maximo_caracteres.
cadena_temporal.Length is an Int and
maximo_caracteres also, so it should work.
Changing
cadena_temporal to
cadenatemporal and
maximo_caracteres to
maximocaracteres removes the error.
Setting
cadenatemporal back to
cadena_temporal is OK!
But setting
maximocaracteres back to
maximo_caracteres shows the error again.
I don't understand why !
But this line
If cadena_temporal.Length < maximo_caracteres Then
doesn't show the error !?
This is the routine I tested:
Code:
Sub justificar_izquierda (cadenaj As String, maximo_caracteres As Int, maximo_lineas As Int)
Dim SF As StringFunctions
Dim listaS As List
Dim Lista_final As List
Dim lista3 As List
Dim cadena_temporal As String
Dim Cadena_final As String
listaS.Initialize
Lista_final.Initialize
lista3.Initialize
SF.Initialize
listaS= SF.StringToList(cadenaj, False, False)
Dim i As Int
For i = 0 To listaS.Size -1
cadena_temporal= listaS.Get(i) & cadena_temporal
If cadena_temporal.Length >= maximo_caracteres Then
Lista_final.Add(Cadena_final)
cadena_temporal=listaS.Get(i)
Cadena_final=listaS.Get(i)
Else
Cadena_final=Cadena_final &" "& listaS.Get(i)
End If
Next
If cadena_temporal.Length < maximo_caracteres Then
Lista_final.Add(Cadena_final)
End If
For i = 0 To Lista_final.Size -1
Log(Lista_final.Get(i))
Next
End Sub
EDIT:
I hadn't seen post#10 when I ansewered.
The problem is that hhhh declared a sub and a variable withe the same name !!!