Notifications
Clear all

[Closed] Escaping string issue on maxscript

Hi,

                                        I have some issues with the edittext of maxscript and string escaping.
                   First, I want to escape the string written in an  edittext (accents and simple quotes). The purpose is to feed this string  to a mysql query.                     

                                        Then I’d like to limit the number of characters  per line in the edittext, force line breaks when the visual width is  reached.                     

                                        Are those things possible in a simple way ? I do  not want to parse all the charcaters in the string and insert line  breaks or espace the special characters manually.                     

                                        Any help appreciated
4 Replies

use System.Windows.Forms.TextBox with WordWrap property ON

Thanks! It works great for line breaking ! And It’s much nicer than the original max components.
Do you have any idea of how I can deal with the quotes and accent thing ?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i don’t understand what you want to do with quotes… add? remove? mask?

I want to espcape them. A string that would originally look like :

"it's an example"

should look like

"it\'s an example"

But the string is taken from the textbox, so I want the escaping to be automatic.

EDIT : I came up with a temporary solution where I check all the quotes in the string and replace them with ’ . But I don’t really like this solution, so if someone has a better idea, I’m all ears