Frances,
My apologies! I re-read your message and realized that when I read it the first time I mistakenly thought that you were proposing assigning the data to PUBLICs, but that was Lailton's code that you had quoted.
Your code is in fact a good example of how to get data out of an array with minimal code. It could be used in my proposed getEvent() method.
I don't know if there is an advantage over using FOR TO, but perhaps it is faster and at the least it is slightly less code. I always like to see alternative solutions too.
So, thanks for posting it, and again my apologies for making my previous comments about it. I guess I need more sleep...
Regards,
James
My apologies! I re-read your message and realized that when I read it the first time I mistakenly thought that you were proposing assigning the data to PUBLICs, but that was Lailton's code that you had quoted.
Your code is in fact a good example of how to get data out of an array with minimal code. It could be used in my proposed getEvent() method.
Method getEvent( cEvent )
local aX
cEvent:= upper(alltrim(cEvent))
FOR EACH aX IN ::aEvents
IF aX[2] == cEvent
uValue:= aX[2]
ENDIF
NEXT
return uValueI don't know if there is an advantage over using FOR TO, but perhaps it is faster and at the least it is slightly less code. I always like to see alternative solutions too.
So, thanks for posting it, and again my apologies for making my previous comments about it. I guess I need more sleep...
Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10