HMG Tutorial Was born

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
zolysoftsolutions
Posts: 139
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Contact:

Re: HMG Tutorial Was born

Post by zolysoftsolutions »

A huge work..
Thank you very much Giovani!
_______________________________
Open eyes for you!
User avatar
mol
Posts: 3757
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG Tutorial Was born

Post by mol »

esgici wrote:
mol wrote:.. known an way to test if index of associative array is defined?...

Code: Select all

? HB_HPOS( hMyHash, 'NotFoundIndex')  // --> 0
You can found details here.
I tried to use associative array to translate logical vaue:

Code: Select all

 aYesNo := {=>}
 aYesNo[ .f. ] := "No"
 aYesNo[ .t. ] := "Yes"
 
I got an compiler error.
Logical keys are not allowed? Am I right? Has abybody more experiences with this?
Last edited by mol on Tue Dec 08, 2015 7:19 am, edited 1 time in total.
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: HMG Tutorial Was born

Post by Carlos Britos »

I got an compiler error.
Logical keys are not allowed? I'm right? Has abybody more experiences with this?
Hi Mol,
I think you need to search in harbour sources/samples for hb_hash()

Code: Select all

to define  hash:

myHash := { "item1"=> .T. ,;
                   "item2" => 1234 ,;
                   "item3" => date() }

setting another value

myHash[ "item1" ] := .F.                   

Regards/Saludos, Carlos (bcd12a)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG Tutorial Was born

Post by esgici »

mol wrote: I tried to use associative array to translate logical vaue:

Code: Select all

 aYesNo := {=>}
 aYesNo[ .f. ] := "No"
 aYesNo[ .t. ] := "Yes"
 
I got an compiler error.
Logical keys are not allowed? I'm right? Has abybody more experiences with this?
Thanks Marek, you are right :arrow:

Has been made correction in VivaClipper page :
Typing :

<key> part of a hash may be any legal scalar type : C, D, L, N ...

Correction : This definition is wrong ! The correct is :

<key> entry key; can be of type: number, date, datetime, string, pointer.


Corrected at : 2015.12.08; thanks to Marek.
Viva HMG :D
Viva INTERNATIONAL HMG :D
Post Reply