HMG Tutorial Was born

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

Re: HMG Tutorial Was born

Post by zolysoftsolutions » Wed Sep 03, 2014 7:03 pm

A huge work..
Thank you very much Giovani!
_______________________________
Open eyes for you!

User avatar
mol
Posts: 2711
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 80 times
Been thanked: 26 times
Contact:

Post by mol » Mon Dec 07, 2015 9:48 pm

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: 219
Joined: Sat Aug 02, 2008 5:03 pm
Has thanked: 6 times
Been thanked: 2 times

Post by Carlos Britos » Mon Dec 07, 2015 10:47 pm

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: 4270
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 146 times
Been thanked: 55 times
Contact:

Post by esgici » Tue Dec 08, 2015 12:09 am

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

Who is online

Users browsing this forum: No registered users and 1 guest