Declarar array tipo, exemplo x : array[0..?,1..5] of string;
01/07/2003
0
bom, aki eu d novo,
preciso declarar um array onde eu nao sei qtos numeros vai ser,
seria algo tipo
x : array[0..?,1..5] of string;
bom se fosse uma array simples era so fazer o seguinte
var y : integer; x : array of string; begin y:=5; SetLength(x,y); end;
teria no final uma array to dipo
x : array[0..4] of string;
mas como faria para ter a outra coluna? alguem sabe?
Desde ja obrigado!!!
Leao
Post mais votado
01/07/2003
SetLength(Matriz, 4, 3) //matriz[0..3] [0..2] Setlength(Matriz,50,3) //Matriz[0..49] [0..2]
Dynamic Array sempre inicia em 0.
Dynamic Array
Matriz[50] = [0..49]
Matriz[10] = [0..10]
Static Array
Matriz[1..50]
Matriz[10..20]
Okama
Mais Posts
01/07/2003
Allan
e pra declarar pode ser algo do tipo :
type
TMyarrayDin = array of integer
e pra trabalhar com ele
Var
Myarray : TMyarrayDin ;
e pra alocar memória pra ele pode ser usando o setlegnht,
SetLenght(Myarray,10) , aí ele aloca um array de 10 inteiros.
Espero ter ajudado !
Allan
01/07/2003
Leao
01/07/2003
Leao
precios declarar uma array q vai ter os seguintes valores
x : array[0..4,1.3] of string;
mas em outra hora ela vai ter o seguinte
x : array[0..50,1..3] of string;
como seria usar o SetLength ? bom uso ele para qdo vou declarar uma array q vai ter so linhas...
Desde ja obrigado!!!
ah qdo escrevio o ´Nossa...´ nao tinha visto sua responta, favor desconcidarar...
03/02/2018
Evaldo
vDAV: ArrayBi;
ix,ij,x,j,vLinha:Integer;
begin
x:=0;
j:=0;
vLinha:=1;
SetLength(vdav, vLinha, 9);
for ix := 0 to 0 do
for ij := 0 to 9 do
vdav[ix, ij] := '';
.
.
.
if vTag = 'idvenda' then
vnDav:=XMLNode.NodeValue;
if vTag = 'data' then
vData:=XMLNode.NodeValue;
if vTag = 'idcliente' then
vCliente:=XMLNode.NodeValue;
if vTag = 'id_externo' then
begin
vDAV[x,J]:= vnDav;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
vDAV[x,J]:=vData;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
vDAV[x,J]:=vCliente;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
vDAV[x,J]:=XMLNode.NodeValue;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
end;
if vTag = 'quantidade' then
begin
vDAV[x,J]:=XMLNode.NodeValue;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
end;
if vTag = 'valor_vendido' then
begin
vDAV[x,J]:=XMLNode.NodeValue;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
end;
if vTag = 'desconto' then
begin
vDAV[x,J]:=XMLNode.NodeValue;
ListBox1.Items.Add(vdav[x,j]);
j:=j+1;
end;
if vTag = 'acrescimo' then
begin
vDAV[x,J]:=XMLNode.NodeValue;
ListBox1.Items.Add(vdav[x,j]);
SetLength(vdav, vLinha + 1, 9);
vLinha := vLinha + 1;
x:= x + 1;
j:=0;
end;
//Peguei alguns pedaços do meu código o que eu queria te mostrar é essa linha
SetLength(vdav, vLinha + 1, 9);
vLinha := vLinha + 1;
Clique aqui para fazer login e interagir na Comunidade :)