I have been trying to pass an Array to function for the purpose of adding/removing a line from different Arrays. Not sure if this is even possible in the manner I have been trying but here's the code I've been trying to get working. Any help is greatly appreciated.
'***********************************************************
Function SubtractLine(SomeArray() as string,SomeArrayCnt as integer,RemoveLine as Integer)
Dim temp2(5000)
if SomeArrayCnt > 0 then
for x = 1 to RemoveLine - 1
temp2(x) = SomeArray(x)
next
for x = Removeline + 1 to SomeArrayCnt
Temp2(x) = SomeArray(x)
next
SomeArrayCnt = SomeArrayCnt - 1
end if
redim SomeArray(SomeArrayCnt)
for x = 1 to SomeArrayCnt
SomeArray(x) = temp2(x)
next
SubtractLine = SomeArray()
end function
'***********************************************************
Function AddLine(SomeArray() as string,SomeArrayCnt as integer,AddLine as string)
Dim temp2(5000)
if SomeArrayCnt > 0 then
for x = 1 to SomeArrayCnt
temp2(x) = SomeArray(x)
next
end if
temp2(SomeArrayCnt+1) = AddLine
SomeArrayCnt = SomeArrayCnt + 1
redim SomeArray(SomeArrayCnt)
for x = 1 to SomeArrayCnt
SomeArray(x) = temp2(x)
next
AddLine = SomeArray()
end function
'***********************************************************
'***********************************************************
Function SubtractLine(SomeArray() as string,SomeArrayCnt as integer,RemoveLine as Integer)
Dim temp2(5000)
if SomeArrayCnt > 0 then
for x = 1 to RemoveLine - 1
temp2(x) = SomeArray(x)
next
for x = Removeline + 1 to SomeArrayCnt
Temp2(x) = SomeArray(x)
next
SomeArrayCnt = SomeArrayCnt - 1
end if
redim SomeArray(SomeArrayCnt)
for x = 1 to SomeArrayCnt
SomeArray(x) = temp2(x)
next
SubtractLine = SomeArray()
end function
'***********************************************************
Function AddLine(SomeArray() as string,SomeArrayCnt as integer,AddLine as string)
Dim temp2(5000)
if SomeArrayCnt > 0 then
for x = 1 to SomeArrayCnt
temp2(x) = SomeArray(x)
next
end if
temp2(SomeArrayCnt+1) = AddLine
SomeArrayCnt = SomeArrayCnt + 1
redim SomeArray(SomeArrayCnt)
for x = 1 to SomeArrayCnt
SomeArray(x) = temp2(x)
next
AddLine = SomeArray()
end function
'***********************************************************