Error in HMG Reference

Source code related resources

Moderator: Rathinagiri

Post Reply
User avatar
Posts: 122
Joined: Tue Oct 07, 2014 11:13 am
Has thanked: 6 times
Been thanked: 16 times

Error in HMG Reference

Post by kcarmody » Wed Oct 22, 2014 9:24 pm

I have noticed an error in the HMG Reference in the HMG DOC folder. Under HMG Unicode / Ansi/Unicode Str. Func, which corresponds to file DOC\data\HMG_UNICODE_DOC\HB_Unicode_Strings.htm, it says that the difference between MEMOREAD/HB_MEMOREAD and MEMOWRIT/HB_MEMOWRIT is that the HB_ functions are not limited to 64K.

Harbour has changed the way these functions work several times, so this may have been true once. But now, all of these functions work up to the maximum Harbour string length, which I believe is 4M. The only difference between MEMOREAD and HB_MEMOREAD is that MEMOREAD removes a Ctrl-Z at the end of the file if one is present, whereas HB_MEMOREAD does not. And the only difference between MEMOWRIT and HB_MEMOWRIT is that MEMOWRIT adds a Ctrl-Z at the end of the file, whereas HB_MEMOWRIT does not.

I generally use MEMOREAD and HB_MEMOWRIT, and avoid HB_MEMOREAD and MEMOWRIT.

At one time Harbour added third parameters to MEMOREAD and MEMOWRIT to control these differences, but these were removed a few years ago. I remember this clearly because this last change broke my code. Harbour is generally pretty stable, but sometimes there are gotchas like this.

I've put a suggested revised version of HB_Unicode_Strings.htm on my site at" onclick=";return false;" onclick=";return false;" onclick=";return false; .


User avatar
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Post by dhaine_adp » Thu Oct 23, 2014 3:52 am

Hi Kevin,

Thanks in pointing that out. I'm glad that your still visiting HMG Forum.



Manila, Philippines

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Thu Oct 23, 2014 12:22 pm

Thank you Kevin to for you advise regarding MEMOREAD/HB_MEMOREAD and MEMOWRIT/HB_MEMOWRIT. This should it be corrected.
By the way there is another correction that it could be fixed too.
Please note at this topic when I mentioned "Building_HMG_applications, some parameters was changed"

Screen_03.PNG (25.72 KiB) Viewed 1142 times
Instead this:
Screen_04.PNG (25.99 KiB) Viewed 1137 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply