Error in HMG Reference
Posted: 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 http://kevincarmody.com/hmg/DOC/" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; .
Kevin
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 http://kevincarmody.com/hmg/DOC/" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; .
Kevin