FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Variables ( Solved )
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Variables ( Solved )
Posted: Tue Sep 08, 2009 02: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 (fw): Select all Collapse
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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Variables ( Solved )
Posted: Wed Sep 09, 2009 03: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

Continue the discussion