Accented Letters Replace with normal letters?

General questions about NeoBook

Moderator: Neosoft Support

Locked
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Accented Letters Replace with normal letters?

Post by Dudus »

Accented Letters to normal?

Hi Folks,

I would have a question about whether it is possible to automatically change the accented letters to normal letters? Or do not let to type in TextField an accented letters?

Thank you!
Dudus
JnCon
Posts: 7
Joined: Tue Sep 20, 2016 8:38 am

Re: Accented Letters Replace with normal letters?

Post by JnCon »

Helló,

meg tudod oldani pl. egy VB script függvénnyel:

Code: Select all

{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%A]|Text|Input
Param=[%B]|Variable|Output
{End}
Function StripAccent (thestring)

Dim A, B, i

Const AccChars= "ŠŽšžYAÁÂAÄAÇEÉEËIÍÎI?NOÓÔOÖŐUÚUÜŰÝaáâaäaçeéeëiíîi?noóôoöuúuüűýy"
Const RegChars= "SZszYAAAAAACEEEEIIIIDNOOOOOUUUUUUYaaaaaaceeeeiiiidnooooouuuuuyy"
For i = 1 To Len(AccChars)
A = Mid(AccChars, i, 1)
B = Mid(RegChars, i, 1)
thestring = Replace(thestring, A, B)
Next
StripAccent = thestring
End Function
    

publication.nbSetVar "[%B]",  StripAccent("[%A]")
Elmented a Function library-be és Call paranccsal meghívod a NeoBook-ból.
Input: az ékezetes szöveg, amit át akarsz alakítani.
Output: a kimenő string változó.

Üdv
Péter
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: Accented Letters Replace with normal letters?

Post by Dudus »

Great Work! Thanks :)
Köszönöm
Locked