HMG 3.4.3
Moderator: Rathinagiri
Re: HMG 3.4.3
Pablo, so we invite you on vacation to Poland.
Polish language you almost mastered, therefore there will be no communication problems.
Polish language you almost mastered, therefore there will be no communication problems.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HMG 3.4.3
Thanks a lot. The same I can tell you when you would like to come to south of Brasil.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HMG 3.4.3
Hi Mr. Hui,
Regarding GetStartUpFolder in ANSI
Any news ? Have you solved ? Have you tested my pre-solution ?
Please give us return...
Regarding GetStartUpFolder in ANSI
Any news ? Have you solved ? Have you tested my pre-solution ?
Please give us return...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: HMG 3.4.3
Pablo César 您好,
我这几天由于休假,没有及时将测试结果回复,请谅解.
我下载了您的程序并进行了测试(在UNICODE和ANSI模式下),结果一切正常.我觉得您的解决方案更稳妥,兼容性更好.非常感谢您的付出.
Hello Pablo César,
I am a few days due to leave, not in time to test results back, please understand.
I downloaded your program and tested it (in UNICODE and ANSI mode) and everything worked fine. I found your solution to be more secure and more compatible. Thank you very much.
我这几天由于休假,没有及时将测试结果回复,请谅解.
我下载了您的程序并进行了测试(在UNICODE和ANSI模式下),结果一切正常.我觉得您的解决方案更稳妥,兼容性更好.非常感谢您的付出.
Hello Pablo César,
I am a few days due to leave, not in time to test results back, please understand.
I downloaded your program and tested it (in UNICODE and ANSI mode) and everything worked fine. I found your solution to be more secure and more compatible. Thank you very much.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HMG 3.4.3
Hi Mr. Hui,
Thank you for reporting.
Have the ANSI strings been treated or are you using directly without any problem?
Thank you for reporting.
That's good ! Is that what I wanted to know. If in ANSI is working good. Because for me it was working a little bit strange in ANSI by my last tests.huiyi_ch wrote:tested it (in UNICODE and ANSI mode) and everything worked fine
Have the ANSI strings been treated or are you using directly without any problem?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: HMG 3.4.3
Once again, I tested the function MyGetStartUpFolder (), In ANSI mode, the function returns the correct result.
Code: Select all
#include <hmg.ch>
REQUEST HB_CODEPAGE_GBK
Function Main
local cpath,i
MyGetStartUpFolder()
hb_CdPSelect("GBK") // "CP936" // GB2312
cpath:=MyGetStartUpFolder()
for i:=1 to ostring:len(cpath)
msginfo(ostring:substr(cpath,i,1))
next
Return
Function MyGetStartUpFolder() // by Pablo on November, 2016 - To remove last unnecessary backslash
LOCAL cStartUpFolder := cFilePath(hb_ProgName())
If HMG_IsCurrentCodePageUnicode()
If hb_URight(cStartUpFolder,1) = "\"
cStartUpFolder := hb_URight( cStartUpFolder, HMG_Len( cStartUpFolder ) - 1 )
Endif
MSGDEBUG("UNICODE",cStartUpFolder)
Else
If Right(cStartUpFolder,1) = "\"
cStartUpFolder := SubStr( cStartUpFolder, 1, Len( cStartUpFolder ) - 1 )
Endif
MSGDEBUG("ANSI",cStartUpFolder)
Endif
Return cStartUpFolder
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HMG 3.4.3
Thank you Mr. Hui.
My system is not in Chinese and I could not test in ANSI.
Dr. Claudio, do you think that is posible to officially replace actual GetStartUpFolder() by this MyGetStartUpFolder() for us ? (not with the same name, of course).
My system is not in Chinese and I could not test in ANSI.
Dr. Claudio, do you think that is posible to officially replace actual GetStartUpFolder() by this MyGetStartUpFolder() for us ? (not with the same name, of course).
Code: Select all
Function MyGetStartUpFolder() // by Pablo on November, 2016 - To remove last unnecessary backslash
LOCAL cStartUpFolder := cFilePath(hb_ProgName())
If HMG_SupportUnicode()
If hb_URight(cStartUpFolder,1) = "\"
cStartUpFolder := hb_URight( cStartUpFolder, HMG_Len( cStartUpFolder ) - 1 )
Endif
MSGDEBUG("UNICODE",cStartUpFolder)
Else
If Right(cStartUpFolder,1) = "\"
cStartUpFolder := SubStr( cStartUpFolder, 1, Len( cStartUpFolder ) - 1 )
Endif
MSGDEBUG("ANSI",cStartUpFolder)
Endif
Return cStartUpFolder
Last edited by Pablo César on Tue Nov 29, 2016 5:12 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG 3.4.3
The code duplication is unnecessary, all HB_Uxxx functions work with ANSI and Unicode.Pablo César wrote:Thank you Mr. Hui.
My system is not in Chinese and I could not test in ANSI.
Dr. Claudio, do you think that is posible to officially replace actual GetStartUpFolder() by this MyGetStartUpFolder() for us ? (not with the same name, of course).
Code: Select all
Function MyGetStartUpFolder() // by Pablo on November, 2016 - To remove last unnecessary backslash LOCAL cStartUpFolder := cFilePath(hb_ProgName()) If HMG_IsCurrentCodePageUnicode() If hb_URight(cStartUpFolder,1) = "\" cStartUpFolder := hb_URight( cStartUpFolder, HMG_Len( cStartUpFolder ) - 1 ) Endif MSGDEBUG("UNICODE",cStartUpFolder) Else If Right(cStartUpFolder,1) = "\" cStartUpFolder := SubStr( cStartUpFolder, 1, Len( cStartUpFolder ) - 1 ) Endif MSGDEBUG("ANSI",cStartUpFolder) Endif Return cStartUpFolder
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
GetStartUpFolder()
Hi Claudio,
I also would agree with you about hb_U... functions are compactibles for UNICODE and ANSI modes. But...
I have tested my friend. Tested with this chinese characters (not our language) I and can confirm to you there is something wrong with hb_USubStr when is chinese characters in ANSI mode.
You can do by yourself this test of demo: But please download this, unpack and run in the chinese subfolder with name "返回结果正确" (but HMG must be rebuilded in ANSI mode). Then you will see it's working removing last backslash. Because is using SubStr intead of hb_USubStr. You can change in the code and compile (the sub-folder will be also updated too automactically). Please Claudio, test it and prove it.
But the right code to replaces GetStartUpFolder by this MyGetStartUpFolder:
Please understand replacement but with the same name of function: GetStartUpFolder() with the contain above code listed.
Please also note, was wrongly using HMG_IsCurrentCodePageUnicode() instead of HMG_SupportUnicode(). I have replaced and this is the right one, same that Mr. Hui tested and corrected in my previous messages too.
Please confirm.
I also would agree with you about hb_U... functions are compactibles for UNICODE and ANSI modes. But...
I have tested my friend. Tested with this chinese characters (not our language) I and can confirm to you there is something wrong with hb_USubStr when is chinese characters in ANSI mode.
You can do by yourself this test of demo: But please download this, unpack and run in the chinese subfolder with name "返回结果正确" (but HMG must be rebuilded in ANSI mode). Then you will see it's working removing last backslash. Because is using SubStr intead of hb_USubStr. You can change in the code and compile (the sub-folder will be also updated too automactically). Please Claudio, test it and prove it.
But the right code to replaces GetStartUpFolder by this MyGetStartUpFolder:
Code: Select all
Function MyGetStartUpFolder() // by Pablo on November, 2016 - To remove last unnecessary backslash
LOCAL cStartUpFolder := cFilePath(hb_ProgName())
If HMG_SupportUnicode()
If hb_URight(cStartUpFolder,1) = "\"
cStartUpFolder := hb_USubStr( cStartUpFolder, 1, HMG_Len( cStartUpFolder ) - 1 )
Endif
Else
If Right(cStartUpFolder,1) = "\"
cStartUpFolder := SubStr( cStartUpFolder, 1, Len( cStartUpFolder ) - 1 )
Endif
Endif
Return cStartUpFolder
Please also note, was wrongly using HMG_IsCurrentCodePageUnicode() instead of HMG_SupportUnicode(). I have replaced and this is the right one, same that Mr. Hui tested and corrected in my previous messages too.
Please confirm.
Last edited by Pablo César on Wed Nov 30, 2016 9:03 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact: