Re: Unicode Control characters

Subject :Re: Unicode Control characters
From :Chip Scheide
Date :Wednesday, November 5, 2014 at 7:57 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId1498075b12e2de5e
Thanks



Really my question was more along the lines of:

do we **really** need to do this sort of thing for text?

or

What is the likelihood of actually encountering "wild" unicode control

characters.

(wild as opposed to self inflicted)



Chip



On Wed, 5 Nov 2014 15:50:55 +0100, Arnaud de Montard wrote:

>

>> Le 5 nov. 2014 à 15:25, Chip Scheide <4dOnly@xxx.xxx> a écrit :

>>

>> for example do I need to "wrap" '=' for text?

>> something like:

>>

>> mytextisEqual(Text1;Text2)

>

> Hi Chip,

> I use this:

>

> +++

> //Strequal (str1;str2) -> bool

> //strict comparison

> CBOOLEAN($0)

> CTEXT($1)

> CTEXT($2)

> CBOOLEAN($outb)

> If (False)

> CBOOLEAN(Strequal ;$0)

> CTEXT(Strequal ;$1)

> CTEXT(Strequal ;$2)

> End if

> //

> $outb:=False //pessimistic

> Case of

> : (Not(Asserted(Count parameters>1;Current method name+" 2 params

> expected")))

> : (Length($1)#Length($2))

> : (Length($1)=0)

> $outb:=True //both are empty

> Else

> $outb:=(Position($1;$2;1;*)=1)

> End case

> $0:=$outb

> //

> +++

>

> One could use regex too, but since the * parameter added in v11,

> Position is faster (and simpler!)

>

> --

> Arnaud de Montard

>

>

>

>

> **********************************************************************

> See how easy it is to extend your 4D solutions to Web and mobile. New

> opportunities await you with 4D v14!

>

> 4D Internet Users Group (4D iNUG)

> FAQ: http://lists.4d.com/faqnug.html

> Archive: http://lists.4d.com/archives.html

> Options: https://lists.4d.com/mailman/options/4dtech

> Unsub: mailto:4DTech-Unsubscribe@xxx.xxx

> **********************************************************************

>

**********************************************************************

See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!



4D Internet Users Group (4D iNUG)

FAQ: http://lists.4d.com/faqnug.html

Archive: http://lists.4d.com/archives.html

Options: https://lists.4d.com/mailman/options/4d_tech

Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx

**********************************************************************

Subject :Re: Unicode Control characters
From :Arnaud de Montard
Date :Wednesday, November 5, 2014 at 7:50 AM
Link :https://kb.4d.com/resources/inug?msgid=GmailId149806ff7bd4c07d


> Le 5 nov. 2014 à 15:25, Chip Scheide <4dOnly@xxx.xxx> a écrit :

>

> for example do I need to "wrap" '=' for text?

> something like:

>

> mytextisEqual(Text1;Text2)



Hi Chip,

I use this:



+++

//Strequal (str1;str2) -> bool

//strict comparison

CBOOLEAN($0)

CTEXT($1)

CTEXT($2)

CBOOLEAN($outb)

If (False)

CBOOLEAN(Strequal ;$0)

CTEXT(Strequal ;$1)

CTEXT(Strequal ;$2)

End if

//

$outb:=False //pessimistic

Case of

: (Not(Asserted(Count parameters>1;Current method name+" 2 params expected")))

: (Length($1)#Length($2))

: (Length($1)=0)

$outb:=True //both are empty

Else

$outb:=(Position($1;$2;1;*)=1)

End case

$0:=$outb

//

+++



One could use regex too, but since the * parameter added in v11, Position is faster (and simpler!)



--

Arnaud de Montard









**********************************************************************

See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!



4D Internet Users Group (4D iNUG)

FAQ: http://lists.4d.com/faqnug.html

Archive: http://lists.4d.com/archives.html

Options: https://lists.4d.com/mailman/options/4d_tech

Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx

**********************************************************************