Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computer Aided Design - CAD > Cadence > Re: putprop err...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 3925 of 4373
Post > Topic >>

Re: putprop error

by Andrew Beckett <andrewb@[EMAIL PROTECTED] > Apr 2, 2008 at 12:38 AM

SS wrote, on 03/12/08 13:31:
> I have the following callback function called everytime something
> changes in a toggle field.
> I am getting the following error
> 
> 
> *Error* putprop: first arg must be either symbol, list, defstruct or
> user type - nil
> 
> Here is my callback procedure
> 
> 
> procedure( toggleCB(form field)
>   let((fieldValue toggleValue lastValue)
>     ;; get the current value of the field
>     fieldValue = getq(get(form field) value)
>     ;; obtain the toggle value, which is the last value in the list
>     toggleValue = car(last(getq(get(form field) value)))
>     ;; store a custom property on this field to mark the last value
>     lastValue = putpropq(get(form field) !toggleValue storedValue)
>     printf("I'm breaking in ToggleAll\n")
>     ;; when the current toggle value is not the same as the stored
> value
>     ;; set the values all on if the toggle is on, or all off otherwise
>     when(toggleValue != lastValue
>       if(toggleValue
>         putpropq(get(form field) mapcar(lambda((x) x t) fieldValue)
> value)
>         putpropq(get(form field) mapcar(lambda((x) x nil) fieldValue)
> value)
>       ); if
>     ); when
>   ); let
> )
> 
> It is erroring out in the putprop statements.
> 
> Could you tell me what is that Iam doing is wrong

Well, the error suggests that it's the putpropq statement. So most likely
it's 
the get(form field) is returning nil, so it's likely to be related to what

you're passing into the toggleCB function - without knowing that, it's
hard to 
tell what's wrong!

You've only given part of the code, and so if form is a variable
containing the 
form data structure, and field is a symbol representing the field name,
all 
should be OK, I think (from a quick read through the code - I didn't check
it 
thoroughly).

Regards,

Andrew.
 




 3 Posts in Topic:
putprop error
SS <ssriramiyer@[EMAIL  2008-03-12 06:31:16 
Re: putprop error
Andrew Beckett <andrew  2008-04-02 00:38:12 
Re: putprop error
SS <ssriramiyer@[EMAIL  2008-04-01 23:10:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 21:06:42 CST 2008.