Delphi - Saludos Ery error en funcion

 
Vista:

Saludos Ery error en funcion

Publicado por henry (4 intervenciones) el 03/11/2006 18:12:21
Function Buscar( S : String) : Array of String;
var
Arreglo : Array of String;
I, J : Integer;
begin
I := 1; J := 0;
SetLength(Arreglo,0);
while I <> 0 do
begin
I := Ansipos(',',S);
if I <> 0 then
begin
Inc(J);
SetLength(Arreglo,J);
Arreglo[J-1] := Copy(S,1,I-1);
S := Copy(S,I+1,Length(S));
end;
end;
Result := Arreglo;

copio este codigo y lo compilo y me da error en la definicion de la funcion espeficamente en array of string.

que puede ser

gracias???
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Saludos Ery error en funcion

Publicado por Ery (42 intervenciones) el 03/11/2006 20:30:11
Uff... Se me olvido declarar el tipo

Type
ArrayOfString = Array of String;

Function Buscar( S : String) : ArrayOfString;
var
Arreglo : ArrayOfString;
I, J : Integer;
begin
I := 1; J := 0;
SetLength(Arreglo,0);
while I <> 0 do
begin
I := Ansipos(',',S);
if I <> 0 then
begin
Inc(J);
SetLength(Arreglo,J);
Arreglo[J-1] := Copy(S,1,I-1);
S := Copy(S,I+1,Length(S));
end;
end;
Result := Arreglo;
end;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar