S
SS
Guest
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
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