AJUDA COM ARRAY
Pessoal,
Tenho dois Arrays
Preciso chercar o valor do arrayA e alimentar/alterar o ArrayB assim:
dim mArrayB
mArrayB = array()
mArrayB = split([Ô]N|N|N|N|N|N|[Ô],[Ô]|[Ô])
dim mArrayA
mArrayA = array()
mArrayA = split(5|,[Ô]|[Ô])
[ô]//////////////////////////////////////////
for i=0 to ubound(mArrayB)
Response.Write i &[Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
next
[ô]Resultado ArrayB
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = N
[ô]5 = N
[ô]/////////////////////////////////////
for z=0 to ubound(mArrayA)
Response.Write z &[Ô]=[Ô] & mArrayA(i) & [Ô]<br>[Ô]
next
[ô]Resultado ArrayA
[ô]0 = 5
Response.Write [Ô]<br>[Ô]
for i=0 to ubound(mArrayB)
for z=0 to ubound(mArrayA)
if mArrayA(z)=[Ô]1[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]2[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]3[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]4[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]5[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]6[Ô] then mArrayB(i)=[Ô]S[Ô] end if
next
next
[ô]Resultado ArrayB DESEJADO
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = S
[ô]5 = N
E se tivesse :
[ô]Resultado ArrayA
[ô]0 = 1
[ô]1 = 5
O Resultado no ArrayB teria que ficar assim :
[ô]0 = S
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = S
[ô]5 = N
Tem Como fazer isso??
Agradeço Qauluer ajuda.
Tenho dois Arrays
Preciso chercar o valor do arrayA e alimentar/alterar o ArrayB assim:
dim mArrayB
mArrayB = array()
mArrayB = split([Ô]N|N|N|N|N|N|[Ô],[Ô]|[Ô])
dim mArrayA
mArrayA = array()
mArrayA = split(5|,[Ô]|[Ô])
[ô]//////////////////////////////////////////
for i=0 to ubound(mArrayB)
Response.Write i &[Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
next
[ô]Resultado ArrayB
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = N
[ô]5 = N
[ô]/////////////////////////////////////
for z=0 to ubound(mArrayA)
Response.Write z &[Ô]=[Ô] & mArrayA(i) & [Ô]<br>[Ô]
next
[ô]Resultado ArrayA
[ô]0 = 5
Response.Write [Ô]<br>[Ô]
for i=0 to ubound(mArrayB)
for z=0 to ubound(mArrayA)
if mArrayA(z)=[Ô]1[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]2[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]3[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]4[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]5[Ô] then mArrayB(i)=[Ô]S[Ô] end if
if mArrayA(z)=[Ô]6[Ô] then mArrayB(i)=[Ô]S[Ô] end if
next
next
[ô]Resultado ArrayB DESEJADO
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = S
[ô]5 = N
E se tivesse :
[ô]Resultado ArrayA
[ô]0 = 1
[ô]1 = 5
O Resultado no ArrayB teria que ficar assim :
[ô]0 = S
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = S
[ô]5 = N
Tem Como fazer isso??
Agradeço Qauluer ajuda.
[txt-color=#0000f0]Dim[/txt-color] mArrayB
mArrayB = Array()
mArrayB = Split([Ô]N|N|N|N|N|N|[Ô], [Ô]|[Ô])
[txt-color=#0000f0]Dim[/txt-color] mArrayA
mArrayA = Array()
mArrayA = Split([Ô]5|[Ô] ,[Ô]|[Ô])
[txt-color=#007100][ô]//////////////////////////////////////////[/txt-color]
[txt-color=#0000f0]For[/txt-color] i = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayB) - 1
Response.Write i & [Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
[txt-color=#0000f0]Next[/txt-color]
[txt-color=#007100][ô]Resultado ArrayB
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = N
[ô]5 = N
[ô]/////////////////////////////////////[/txt-color]
Response.Write [Ô]<br>[Ô]
[txt-color=#0000f0]For[/txt-color] z = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayA) - 1
Response.Write z & [Ô]=[Ô] & mArrayA(z) & [Ô]<br>[Ô]
Next
[txt-color=#007100][ô]Resultado ArrayA
[ô]0 = 5[/txt-color]
Response.Write [Ô]<br>[Ô]
[txt-color=#0000f0]For[/txt-color] i = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayB) - 1
[txt-color=#0000f0]For[/txt-color] z = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayA) - 1
mArrayB(mArrayA(z) - 1) = [Ô]S[Ô]
[txt-color=#0000f0] Next[/txt-color]
[txt-color=#007100] [ô]Resultado[/txt-color]
Response.Write i & [Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
[txt-color=#0000f0]Next[/txt-color]
Atenciosamente,
Fabio Araujo Damascena
mArrayB = Array()
mArrayB = Split([Ô]N|N|N|N|N|N|[Ô], [Ô]|[Ô])
[txt-color=#0000f0]Dim[/txt-color] mArrayA
mArrayA = Array()
mArrayA = Split([Ô]5|[Ô] ,[Ô]|[Ô])
[txt-color=#007100][ô]//////////////////////////////////////////[/txt-color]
[txt-color=#0000f0]For[/txt-color] i = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayB) - 1
Response.Write i & [Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
[txt-color=#0000f0]Next[/txt-color]
[txt-color=#007100][ô]Resultado ArrayB
[ô]0 = N
[ô]1 = N
[ô]2 = N
[ô]3 = N
[ô]4 = N
[ô]5 = N
[ô]/////////////////////////////////////[/txt-color]
Response.Write [Ô]<br>[Ô]
[txt-color=#0000f0]For[/txt-color] z = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayA) - 1
Response.Write z & [Ô]=[Ô] & mArrayA(z) & [Ô]<br>[Ô]
Next
[txt-color=#007100][ô]Resultado ArrayA
[ô]0 = 5[/txt-color]
Response.Write [Ô]<br>[Ô]
[txt-color=#0000f0]For[/txt-color] i = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayB) - 1
[txt-color=#0000f0]For[/txt-color] z = 0 [txt-color=#0000f0]To UBound[/txt-color](mArrayA) - 1
mArrayB(mArrayA(z) - 1) = [Ô]S[Ô]
[txt-color=#0000f0] Next[/txt-color]
[txt-color=#007100] [ô]Resultado[/txt-color]
Response.Write i & [Ô]=[Ô] & mArrayB(i) & [Ô]<br>[Ô]
[txt-color=#0000f0]Next[/txt-color]
Atenciosamente,
Fabio Araujo Damascena
Tópico encerrado , respostas não são mais permitidas