|
Post by George on Jan 13, 2019 12:50:46 GMT -5
Robert: Thanks, but done already, took about 25-30 lines of grungy code.
I'll send you a test version.
George
|
|
|
Post by mueh on Feb 1, 2019 2:43:59 GMT -5
Sorry George ! Setting InvChar to Blank is not perfectly fixed . After SPFLite Restart InvChar is a NULL string as you can see in Translation and MSG Substitution character cannot be Null if DONE in OPT is issued . Above Picture is with Lucida Console font and Shows also the INI file with 1 blank for every Done i issued in OPT . Following is the Code Setting the NULL string with the suggested solution . FUNCTION sINIGetString(BYVAL sSection AS STRING, BYVAL sKey AS STRING, BYVAL sDefault AS STRING) AS STRING
'---------- Get string from ini file
LOCAL RetVal AS LONG, zResult AS ASCIIZ * 32768
LOCAL zSection AS ASCIIZ * %MAX_PATH, zKey AS ASCIIZ * %MAX_PATH
LOCAL zDefault AS ASCIIZ * %MAX_PATH
LOCAL t AS STRING
t = ENV.INIFileName
zSection = sSection : zKey = sKey '
zDefault = sDefault '
RetVal = GetPrivateProfileString(zSection, zKey, zDefault, zResult, SIZEOF(zResult), ENV.INIFileName)
IF RetVal THEN FUNCTION = LEFT$(zResult, RetVal) '
END FUNCTION
As a solution in _ObjENV.inc after
InvChar = sINIGetString("General", "InvChar", ".")
there should be
if InvChar = "" then InvChar = " "
Thanks George
|
|
|
Post by George on Feb 1, 2019 12:41:38 GMT -5
MUEH: The Options logic right now prevents you from setting the substitution character to null. Since the only way it could be null is by some direct manipulation of the INI file (which is always "You're on your own") , or some prior "Oops" as we fiddled in this area previously.
There's no sense in both checking and issuing an error message AND replacing any null with '.'. At some point you just have to say "Set the character to SOMETHING" and be done with it.
George
|
|
|
Post by George on Feb 1, 2019 17:04:05 GMT -5
Robert: Also remember that X'00' is not really a NULL. A NULL in PB programming terms is a zero length string. In PB strings can contain all 256 characters. You're describing ASCIIZ strings which are C compatible strings ending with a X'00'.
Small point, but significant depending on to whom you're passing the string.
George
==> Right George, but I was speaking in terms of pasting something into a dialog field with Ctrl V. You can't, because Windows internally terminates all clipboard text data with X'00'.
|
|
|
Post by mueh on Feb 2, 2019 3:48:23 GMT -5
George Robert: Thanks for your Effort . Last try to explain Problem . 1. I'm not editing the INI File . 2. Setting INVCHAR in OPT to BLANK . Translation to BLANK works . 3. EXIT SPFLite 4. Start SPFLite again . 5. INVCHAR is not BLANK . it is now a NULL String . See Picture on previous update ( no Translation . Error MSG in OPT if DONE is issued ) Robert: Before 10.1.9014 is used x'FF' for Terminal font and x'A0' for other font's to avoid the loop and get Translation to Blank . Thanks for your Patience .
|
|
|
Post by George on Feb 2, 2019 12:53:14 GMT -5
mueh: OK, my apologies for not grasping the problem correctly. You're correct and it's caused by the way the INVCHAR is stored in the INI file. It's done without quotes, so you end up with an INI line of INVCHAR=. Which results in a NULL the next time it gets read.
So your suggested code fix is correct.
I'll add that line.
George
|
|