Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't read the array values when i used the redim 1

Status
Not open for further replies.

wmlix

Programmer
Dec 12, 2000
2
NL
can someone help me to check this code?

i used formula @first to read all the record data into the array

shared names() as string
global teller as number
if not isnull ({DEPT.DPNAME]) then
teller = teller + 1
redim preserve names(teller)
names(teller) = {DEPT.DNAME}
formula = names(teller)
end if



for printing all the value's i used formula @hf1 @hf2 hf2 etc.

@hf1
shared names() as string
formula = names(1)


@hf2
shared names() as string
redim preserve names(2)
formula = names(2)

@hf3
shared names() as string
redim preserve names(3)
formula = names(3)

but i can only print some of the data from the array. What's wrong with the code?
 
Don't redim your array in the @hf.. formulas. That is why you are losing the data you saved in formula @first. The "preserve" only saves data to the redim value of the array. The rest is lost.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top