Variables ( Solved )

User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Variables ( Solved )

Post by James Bott »

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.

Code: Select all

Method getEvent( cEvent )
   local aX
   cEvent:= upper(alltrim(cEvent))
   FOR EACH aX IN ::aEvents
      IF aX[2] == cEvent
         uValue:= aX[2]
      ENDIF
   NEXT
return uValue
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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Variables ( Solved )

Post by fraxzi »

Dear James,

No apology needed :)

xHarbour's FOR TO is much faster than the old one. At least to my experience.


My best regards!

-Frances



PS. I need sleep too... LOL!
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Post Reply