PDA

View Full Version : Allow only a valid new partname


Lim Chee Beng
10-07-2004, 01:32 AM
:value-type : part
- It allows selection of the existing part.

:value-type : part-incl-new
- Beside selection of the existing parts, it also allows to define new valid partname as well.

Is there a quick programmatical way to allow user only entering a valid new partname or selecting an empty part?

dorothea
10-07-2004, 04:10 AM
Hello,

Use the value-type :part-incl-new and add a check-function like this


:check-function #'(lambda (pa)
(if (sd-string-p pa)
:ok
;; else
(if (sd-inq-empty-part-p pa)
:ok
(values :error "Not a string and not an empty part.")
)
)
)


This does exatly what you want.

Dorothea

Wolfgang
10-09-2004, 03:41 AM
for 2byte-char environment use

...
not needed!
(if (or (sd-string-p pa) (sd-ext-string-p pa))
not needed!
...



### 15oct2004 ###
Hi,

I have to correct this posting:

I got informed that this double checking is not needed. I can not remember why I used it in the past (years ago), but I did.

But there's no need to do so. (sd-string-p..) detects also 2byte-char-string.

Sorry for confusion :(