Re: XForms: what function needed?

Steve Lamont (spl@szechuan.ucsd.edu)
Sat, 2 Jan 99 09:09:21 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> If I want to check an input string for *not* containing characters like
> quotes, pipes and other unix symbols, how should that be done? With
> "norma" chars I can easily do that.

There are several ways to do this. You can use the function strpbrk()
to check if any of your "bad" characters appear in the string.
strspn() or strcspn() can also be used. You can also write a regular
expression and use regex (re_comp()/re_exec()) or the regexp package,
as your tastes suit, though this might be overkill in this case.
Refer to the man pages for the appropriate functions.

If you're trying to filter an input object in XForms, you should look
at the different forms of input object or for more elaborate
filtering, the input filter function. See the XForms manual for
details.

> Trying something like *pointer != ''' (or only ') I get missing closing quotes.

*pointer != '\''

is correct syntax. The backslash (\) escapes the apostrophe.

> Thank you very much (won't ask to much pure C here, sorry again)

If you don't have it, you should run, not walk, over to your favorite
technical bookstore (or the computer section in most bookstores these
days) and get a copy of _The C Programming Language, 2nd Edition_ by
Kernighan and Ritchie. They answer *everything* you need to know
about C in one of the best, most succinctly written, and lucid manuals
ever written on the subject.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/