Code Red > AutoLISP (Vanilla / Visual)

multiple radio buttons working together?

<< < (8/8)

sln8458:
Ron,


--- Quote ---And when using strcat to compose the filename the variables used have to contain strings, so you have to either initialize default string values or determine all of them by checking the current state of the dialog.
--- End quote ---

I am confused by this statement (I suspect you are not surprised ).

For each radio button I thought I had defined the variable as a string
eg

--- Quote ---   (defun RB41_FLAG ()
   (setq sch "sch_5")                              ;store schedule rating
   );end rb41_flag
--- End quote ---
In this case when radio button 41 is selected the string "sch_5" is stored as the current value for the variable sch

where a string is defined as any group of characters  having quotation marks surrounding them to indicate that they are strings

As only 1 radio button in each column can be active, hence am I not "determine all of them by checking the current state of the dialog"

Could you explain a little more please?

S.

sln8458:
Well I finally found the problem.
It was me all along, such a small thing caused me so much grief.

What was it? I had missed a '_' from the schedule string. (just as Roy had hinted at)

In the above example:

--- Code: ---   (defun RB41_FLAG ()
   (setq sch "sch_5")                              ;store schedule rating
   );end rb41_flag
--- End code ---

This now reads:

--- Code: ---   (defun RB41_FLAG ()
   (setq sch "sch_5_")                              ;store schedule rating
   );end rb41_flag
--- End code ---

Thanks
S.

sln8458:
I'm back for a bit more guidance please.

So far I have had simple Action Tiles, I now need to make some a little more complicated (for me!)

Example

--- Code: --- (action_tile "rb31" ;toggle #300 option
"(L5_ON)(RB31_FLAG)"
); END ACTION TILE
--- End code ---


--- Code: --- (action_tile "rb31" ;toggle #300 option
      "(setq newtile $key)(RB31_FLAG)(F_NAME)(READ_DIM_FILE)"
); END ACTION TILE
--- End code ---

Both of the above have been used as this project has progressed and both work as I expected.
Now I want to use both depending on a previous radio button selection (rb11)
Here is rb11 code

--- Code: --- (defun RB11_FLAG ()
(setq flg "wn_") ;store flange type
);end rb11_flag
--- End code ---


In words:
if the user selects rb11 I want to execute the first code above, and if rb11 is not selected (any of the other options selected) then I want to execute the second code above.

So here is what I have:

--- Code: --- (action_tile "rb31" ;toggle #150 option
(if
(= flg wn_) ;if variable weldneck flange selected do this
(progn
(L5_ON)
(RB31_FLAG)
);end progn
;---------------------------;
; ;otherwise  if ANY of bl/so/scr/sl are set do this
(progn
(setq newtile $key)
(RB31_FLAG)
(F_NAME)
(READ_DIM_FILE)
);end progn
) ;_ end of if
); END ACTION TILE
--- End code ---

When I select rb31 nothing happens!
Where have I gone wrong?
Can I actually do this?
Any help would be appreciated.

S.

roy_043:

--- Code - Auto/Visual Lisp: ---(action_tile  "rb31"  "(if (= flg \"wn_\")    (progn      (L5_ON)      (RB31_FLAG)    )    (progn      (setq newtile $key)      (RB31_FLAG)      (F_NAME)      (READ_DIM_FILE)    )  )")

sln8458:
Many thanks Roy.
Works a treat :)

S.

Navigation

[0] Message Index

[*] Previous page

Go to full version