PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Escape Character
Escape Character
Débuté par funtoosh, 23 juin 2014 19:30 - 2 réponses
Membre enregistré
6 messages
Posté le 23 juin 2014 - 19:30
Hi
I've recently moved to Windev from C# and i'm really enjoying it

But i've one query what is the escape character in Windev ?

Like in C# the escape character is "\" , what is the escape character in windev ?

Thanks

--
Kapil Jain
Posté le 23 juin 2014 - 23:25
hi,

With Windev, you don't need any Escape Character.
Here some examples :
str = "ab""c" + RC + "d"
Info(str) // Result is : a'b"c on 1st line, and d on 2nd line


New version, exists since version WD12 (?) , very simple to use :
str = [
a'b"c
d
]
Info(str) // same result as example n°1


These examples are very simple.
In real life, it is generally more complex :
For example, you read a description X in a file, and you need to build a string with this description X .
Depending of what you need , character ' in the description X may be a problem, or character " may be a problem.

You should use function sFormat, with 2nd parameter ' or " :
Procedure sFormat (pCh, xx = "'")
sCh is string =Remplace(pCh, xx , xx+xx )
IF sCh="" THEN sCh=" "
RETURN xx+sCh+xx


I need very often to use this function, with 2nd parameter '.
And in very specific cases, I need to use it with 2nd parameter "

newstring = sFormat ( string , """")
OR
newstring = sFormat ( string , Charact (34) ) // these 2 lines are totally similar.
Membre enregistré
6 messages
Posté le 24 juin 2014 - 08:15
Thanks, ascii code looks neat

--
Kapil Jain