How to use EscapeString()

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jun 7 01:25:30 CDT 2003


on 6/7/03 1:10, Howard Steadman at hsteadma at fulltilt.com wrote:

> This is great. Where is the documentation or wxample on escaping?

No yet nothing.

And I even have not see it self, no time yet.
Other developer have implement it.

Look into FBL_StringUtilities.cpp file.
It contains sources of this function.

-----
How to use it?
Very simple.

Let you have from user input some string variable

    char* s = "man's child"

You want concatenate it with SQL string

    char template[] = "SEELCT * FROM T WHERE fld ='%s'";

Before that you build escaped string:

    char* s_esc = EscapeString( s, true );

And now build string

    char query[1024];
    sprintf( query, template, s_esc );


IMPORTANT

1) please check sources of escapeString() to see if new string must be
delete. I think so.

2) for now you need always send second parameter of escapeString() as true,
Because Valentina now only use REGEX search.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list