Variables ( Solved )

Re: Variables ( Solved )

Postby James Bott » Tue Sep 08, 2009 2:25 pm

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  Expand view
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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Variables ( Solved )

Postby fraxzi » Wed Sep 09, 2009 3:35 am

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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 106 guests