Uniface on GitHub
Product (releases and patches)
Reported Issues (old)
Fixes and Updates
Short of writing a 3gl function to do this.....
I'm processing a number of txt files - and every now and then I come across a control character
which causes good ol' Uniface to have a hissy fit.
The control character in question is HEX 0x1a - Ascii 26.
I've tried a $replace in combination with $tometa (result in a $2) - no joy..
Any other ideas out there?
Changing the snippet to encode the string as URAW also gives the correct result for characters
string e, s, z, r
r = "-X-"
for $n$ = 0 to 255
z = "&#%%$n$%%%;"
c = $encode("URAW", $string(z))
s = $concat("A...", c, "...Z")
s = $replace(s, 1, c, r, -1)
putmess "%%z : %%s"
This threw me for a loop for quite some time...
Until - doing a fileload/raw, $replace, filedump/raw which finally fixed the darn control character.
Nasty solution, but do you try to input the character "26" directly in $replace.
like $replace(buffer,1,"→" ,"",-1)
→ : alt+numpad 26.
Are there much more undocumented Features in Uniface like $tometa???
Can't find anything in Uniface Documentation about $tometa!!!
Take a sample program:numeric dis(9999) nvariables string c, e, s, z, rendvariablesr = "-X-"for $n$ = 0 to 255 z = "&#%%$n$%%%;" c = $string(z) s = $concat("A...", c, "...Z") s = $replace(s, 1, c, r, -1) putmess "%%z : %%s"endfor
: A......Z : A...-X-...Z : A......Z
$replace will replace all characters but  and
That's not really nice UNIFACE!
Please STOP this!!!
Have you tried the $string function? https://u.uniface.info/docs/1000/uniface/proc/reference/ProcFunctions/_string.htm#microcontent1
processing a list created from comma separated line items ==> internal UF infinite loop - 100% cpu usage.
Out of curiosity, what kind of hissy fit?
© 2020 Uniface Privacy & Cookies | Privacy Statement | Legal