Re: HMG 3.4.3
Posted: Thu Nov 24, 2016 12:34 pm
Pablo i will check.
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://hmgforum.com/
Great work, Pablo!Pablo César wrote:Thank you Mr. Yi for reporting your results and happy to know is satisfactory. The problem was not only for chinese characters, there are other languages with special characters that it could have been affected at time ago... now is solved, I guess.huiyi_ch wrote:After a preliminary test, the program(unicode and ANSI mode) for the INI file in Chinese characters, set and get all normal, the problem have been solved perfectly.
HB_Uxxx string functions work with any CP ( ANSI and Unicode ).huiyi_ch wrote:Claudio Soto博士您好:
我想向您提一点建议,请在HMG_TString类中,增加按字节提取字符串的一些方法,尤其在ANSI模式下,我认为很有必要!这样在使用HMG_TString类对字符串进行处理时,将变的更加统一、规范、方便。
Hello Dr. Claudio Soto
I want to make a suggestion to you, please in the HMG_TString class, increase some methods for extracting parts of a character string by byte, especially in the ANSI mode, I think it is necessary! So,when using HMG_TString class to operate the string, will become more unified, standardized, convenient.
METHOD BLeft (cString, nCount) INLINE HB_BLEFT (cString, nCount)
METHOD BRight(cString, nCount) INLINE HB_BRIGHT (cString, nCount)
METHOD BSubStr(cString, nStart, nCount) INLINE HB_BSUBSTR (cString, nStart, nCount)
Code: Select all
#include <hmg.ch>
request hb_codepage_gbk
Function Main()
local path:=""
hb_CdPSelect("GBK") //with chinese os, in ANSI moden must used hb_CdPSelect("GBK") ,else display "?????"
path:=cFilePath(hb_ProgName())
msginfo(path)
msginfo(getcurrentfolder())
Return nil
Hello Dr. Claudio Sotosrvet_claudio wrote:HB_Uxxx string functions work with any CP ( ANSI and Unicode ).huiyi_ch wrote:Claudio Soto博士您好:
我想向您提一点建议,请在HMG_TString类中,增加按字节提取字符串的一些方法,尤其在ANSI模式下,我认为很有必要!这样在使用HMG_TString类对字符串进行处理时,将变的更加统一、规范、方便。
Hello Dr. Claudio Soto
I want to make a suggestion to you, please in the HMG_TString class, increase some methods for extracting parts of a character string by byte, especially in the ANSI mode, I think it is necessary! So,when using HMG_TString class to operate the string, will become more unified, standardized, convenient.
METHOD BLeft (cString, nCount) INLINE HB_BLEFT (cString, nCount)
METHOD BRight(cString, nCount) INLINE HB_BRIGHT (cString, nCount)
METHOD BSubStr(cString, nStart, nCount) INLINE HB_BSUBSTR (cString, nStart, nCount)
It's making sense, his request Claudio.huiyi_ch wrote:Hello Dr. Claudio Sotosrvet_claudio wrote:HB_Uxxx string functions work with any CP ( ANSI and Unicode ).huiyi_ch wrote:Claudio Soto博士您好:
我想向您提一点建议,请在HMG_TString类中,增加按字节提取字符串的一些方法,尤其在ANSI模式下,我认为很有必要!这样在使用HMG_TString类对字符串进行处理时,将变的更加统一、规范、方便。
Hello Dr. Claudio Soto
I want to make a suggestion to you, please in the HMG_TString class, increase some methods for extracting parts of a character string by byte, especially in the ANSI mode, I think it is necessary! So,when using HMG_TString class to operate the string, will become more unified, standardized, convenient.
METHOD BLeft (cString, nCount) INLINE HB_BLEFT (cString, nCount)
METHOD BRight(cString, nCount) INLINE HB_BRIGHT (cString, nCount)
METHOD BSubStr(cString, nStart, nCount) INLINE HB_BSUBSTR (cString, nStart, nCount)
It is very possible that you do not understand what I mean! In HMG, I will use the method of the hmg_string class in a unified way, without going to use the function!
Code: Select all
METHOD BLeft (cString, nCount) INLINE HB_BLEFT (cString, nCount)
METHOD BRight(cString, nCount) INLINE HB_BRIGHT (cString, nCount)
METHOD BSubStr(cString, nStart, nCount) INLINE HB_BSUBSTR (cString, nStart, nCount)
Code: Select all
STATIC FUNCTION ntohl( c )
IF hb_Version( HB_VERSION_ENDIANNESS ) == HB_VERSION_ENDIAN_LITTLE
RETURN ;
hb_BSubStr( c, 4, 1 ) + ;
hb_BSubStr( c, 3, 1 ) + ;
hb_BSubStr( c, 2, 1 ) + ;
hb_BSubStr( c, 1, 1 )
ENDIF
RETURN c
Code: Select all
#include <hmg.ch>
REQUEST HB_CODEPAGE_GBK
Function Main
hb_CdPSelect("GBK")
MSGDEBUG(MyGetStartUpFolder())
Return
Function MyGetStartUpFolder() // by Pablo on November, 2016 - To remove last unnecessary backslash
LOCAL cStartUpFolder
If HMG_IsCurrentCodePageUnicode()
cStartUpFolder := cFilePath(hb_ProgName())
Else
MsgInfo("In ANSI")
cStartUpFolder := cFilePath(GetProgramFileName())
Endif
If hb_ULeft(cStartUpFolder,1) = "\"
cStartUpFolder := hb_ULeft( cStartUpFolder, HMG_Len( cStartUpFolder ) - 1 )
Endif
Return cStartUpFolder
Code: Select all
HB_FUNC( GETPROGRAMFILENAMEA )
{
CHAR Buffer [MAX_PATH + 1];
GetModuleFileNameA(GetModuleHandle(NULL), Buffer, MAX_PATH);
hb_retc(Buffer);
}
HB_FUNC( GETMODULEFILENAMEA )
{
CHAR Buffer [MAX_PATH + 1];
HMODULE hModule = HB_ISNIL(1) ? GetModuleHandle(NULL) : (HMODULE) HMG_parnl(1);
GetModuleFileNameA(hModule, Buffer, MAX_PATH);
hb_retc(Buffer);
}