Can i make a variable set based upon a select using this code or something similar
(setq X (getkword "\nWhat should X equal? [Time,Money,Help] :"))
|
Can i make a variable set based upon a select using this code or something similar
(setq X (getkword "\nWhat should X equal? [Time,Money,Help] :"))
Sorry for any syntax errors; posting from an iPhone:
Code:(if (and (not (initget "Time Money Help")) (setq X (getkword "\nWhat should \"X\" equal? [Time,Money,Help] :")) ) (prompt (strcat "\nYou entered \"" X "\" for the value of \"X\" ")) )
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Another question...the X variable needs to interact with other instances there for the variable must show the whole word.
Is there a way I can do this with getstring without entering the whole word...
So If I have (setq X (getstring "\nWhat should X equal? [Time,Money,Help] : "))
If i enter just H for Help it sets X's string equal to H in other references of X in a code.
Can I make that string = Help without entering the whole word
Maybe with something like Y=X string based on the letter entered, then having Y reference the rest of the code.
Also how did you encapsulate your code in your post?
Try adding a CONDitional statement:
Code:(if (and (not (initget "Time Money Help")) (setq X (getkword "\nWhat should \"X\" equal? [Time,Money,Help] :")) (setq X (strcase X)) ) (prompt (strcat "\nYou entered \"" (cond ((wcmatch X "T*") "Time") ((wcmatch X "M*") "Money") ((wcmatch X "H*") "Help") ) "\" for the value of \"X\" " ) ) )
Also, see posting guidelines for use of [ CODE ] tags; posting from mobile, so sorry for not providing direct link. You can quote my post to see more.
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Any ideas why this isn't continuing after value of x is returned?Code:(defun C:Test (/ kw X) (while (and (not (initget 7 "Yes No")) (setq kw (getkword "\nDefine X? [Yes,No] :")) (eq kw "Yes") (if (and(not (initget "Time Money Help")) (setq X (getstring "\nWhat should \"X\" equal? [Time,Money,Help] :")) (setq X (strcase X)) ) (prompt (strcat "\nYou entered \"" (cond ((wcmatch X "T*") "Time") ((wcmatch X "M*") "Money") ((wcmatch X "H*") "Help") ) "\" for the value of \"X\" " ) ) ) ) ) )
I apologize for the lack of bracket spacing...I just can't seem to find how to enclose my code
Last edited by BlackBox; 2015-05-18 at 04:41 AM. Reason: Please use [CODE] Tags
I'll let you identify the difference in code logic:
Code:(defun C:Test (/ kw X) (while (and (not (initget 7 "Yes No")) (setq kw (getkword "\nDefine X? [Yes,No] :")) (eq kw "Yes") ) (if (and (not (initget "Time Money Help")) (setq X (getstring "\nWhat should \"X\" equal? [Time,Money,Help] :" ) ) (setq X (strcase X)) ) (prompt (strcat "\nYou entered \"" (cond ((wcmatch X "T*") "Time") ((wcmatch X "M*") "Money") ((wcmatch X "H*") "Help") ) "\" for the value of \"X\" " ) ) ) ) )
No worries; we all start somewhere... This should help:
http://forums.augi.com/misc.php?do=bbcode
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
How can I repeat the same results with a response of same results...
I don't just want the results to be displayed again but actually stored and reentered essentially
So I'd define x, define y then be prompted to repeat same results and the definitions would be once again defined as the original input string
Code:(defun C:Test (/ kw X) (while (and (not (initget 7 "Yes No")) (setq kw (getkword "\nDefine X? [Yes,No] :")) (eq kw "Yes") ) (if (and (not (initget "Time Money Help")) (setq X (getstring "\nWhat should \"X\" equal? [Time,Money,Help] :" ) ) (setq X (strcase X)) ) (prompt (strcat "\nYou entered \"" (cond ((wcmatch X "T*") "Time") ((wcmatch X "M*") "Money") ((wcmatch X "H*") "Help") ) "\" for the value of \"X\" " ) ) ) (if (and (not (initget "Time Money Help")) (setq Y (getstring "\nWhat should \"Y\" equal? [Time,Money,Help] :" ) ) (setq Y (strcase Y)) ) (prompt (strcat "\nYou entered \"" (cond ((wcmatch Y "T*") "Time") ((wcmatch Y "M*") "Money") ((wcmatch Y "H*") "Help") ) "\" for the value of \"Y\" " ) ) ) ) )
I'm not entirely sure that I understand what you're asking; perhaps you could clarify?
In any event, here's a quick stab in the dark:
Code:(defun c:FOO (/ _GetValue kw x y) (defun _GetValue (x) (cond ((wcmatch x "T*") "Time") ((wcmatch x "M*") "Money") ((wcmatch x "H*") "Help") ) ) (while (and (not (initget 7 "Yes No")) (setq kw (getkword "\nDefine X? [Yes/No] :")) (eq kw "Yes") ) (if (and (or *Option1* (setq *Option1* "Time") ) (not (initget "Time Money Help")) (or (/= "" (setq x (getstring (strcat "\nWhat should \"X\" equal? [Time/Money/Help] " (if *Option1* (strcat "<" *Option1* ">: ") ": " ) ) ) ) ) (setq x *Option1*) ) (setq *Option1* x) ) (prompt (strcat "\nYou entered \"" (_GetValue x) "\" for the value of \"X\" " ) ) ) (if (and (or *Option2* (setq *Option2* *Option1*) ) (not (initget "Time Money Help")) (or (/= "" (setq y (getstring (strcat "\nWhat should \"Y\" equal? [Time/Money/Help] " (if *Option2* (strcat "<" *Option2* ">: ") ": " ) ) ) ) ) (setq y *Option2*) ) (setq *Option2* y) ) (prompt (strcat "\nYou entered \"" (_GetValue y) "\" for the value of \"Y\" " ) ) ) ) )
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000