FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV Mobile 2024
→
Android arrayDeleteLine replacement
Android arrayDeleteLine replacement
Iniciado por Stewart MICHAEL, 15,sep. 2016 10:44 - 1 respuesta
Conéctese…
Stewart MICHAEL
#1
Publicado el 15,septiembre 2016 - 10:44
Apparently Android does not have an equivalent for this function and so I wrote my own. Sadly this is running into an unexpected issue. I am essentially converting the array to a string removing the line from the string and then putting it back.
The strange thing is that this works once but any attempts to repeat the process result in the stringToArray line failing and I end up with a one dimensional array not a two.
Procedure
garr
FileRemoveLine
(i)
s
Arr is
string
=
ArrayToCSV
(
garr
File
,
";"
)
SWITCH
i
CASE
1
s
Arr
=
Right
(
s
Arr
,
Length
(
s
Arr
)
-
PositionOccurrence
(
s
Arr
,
CR
,
1
)
+
1
)
CASE
ArrayCount
(
garr
File
)
s
Arr
=
Left
(
s
Arr
,
PositionOccurrence
(
s
Arr
,
CR
,i-
1
)
-
1
)
OTHER
CASE
n
Cut1 is
int
=
PositionOccurrence
(
s
Arr
,
CR
,i-
1
)
+
1
n
Cut2 is
int
=
PositionOccurrence
(
s
Arr
,
CR
,i)
+
1
s
Left is
string
=
Left
(
s
Arr
,
n
Cut1
)
s
Right is
string
=
Right
(
s
Arr
,
Length
(
s
Arr
)
-
n
Cut2
)
s
Arr
=
s
Left
+
s
Right
END
DeleteAll
(
garr
File
)
StringToArray
(
s
Arr
,
garr
File
,
CR
,
";"
)
gn
FileDown
=
ArrayCount
(
garr
File
)
gn
FileAcross
=
Dimension
(
garr
File
)
/
gn
FileDown
Any suggestions greatly welcome
Thanks
Mike
Informar
0
0
Mike Stewart
#2
Publicado el 15,septiembre 2016 - 16:14
those eagle eyed among you will have spotted that the + on the top line of code should have been a minus...
This line at present creates a blank line at the top of the file.
The next time the code is used the code assumes that the array only has 1 column as there is nothing in it to tell it otherwise
Informar
0
0
→ Volver a WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto