cadfan Posted April 8, 2015 Share Posted April 8, 2015 Hey,guys. (action_tile "th" "(setq scl (distof $value))") What does this mean ? "th" is a key of "Edit_box", I want "Edit_box" can only enter Numbers, can't enter character. How to do ? I want "Edit_box" can memory , when dialog exit--->start again, the value in the edit box is the last , not default value . How to do ? Thanks for any help. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 9, 2015 Share Posted April 9, 2015 Distof "Converts string which contains a real, display format by mode". (setq scl $value) will now accept alpha or 0-9 but it will be a string not a number in case of 0-9. You can pass a default value to be used in your DCL. No code posted so no idea how to show example. Quote Link to comment Share on other sites More sharing options...
cadfan Posted April 9, 2015 Author Share Posted April 9, 2015 Distof "Converts string which contains a real, display format by mode". (setq scl $value) will now accept alpha or 0-9 but it will be a string not a number in case of 0-9. You can pass a default value to be used in your DCL. No code posted so no idea how to show example. Tks, but I need a sample. Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted April 9, 2015 Share Posted April 9, 2015 if is your dialog file editbox is dcl ID "number" is the key for edit_box, or "th" of yours. *memory* is global default value (setq *memory* (if (and *memory* (= (type *memory*) 'STR)) *memory* "[b]0.000[/b]")) (defun c:test (/ dcl_id dd) (setq dcl_id (load_dialog [b][color="red"]<editbox.dcl>[/color][/b] ) dd 1) (while (or (not (numberp (read *memory*)))(= dd 1)) (new_dialog "[color="red"]editbox[/color]" dcl_id) (set_tile "[color="red"]number"[/color] *memory*) (action_tile "accept" "(setq *memory* (get_tile \"number\"))(done_dialog 0)") (setq dd (start_dialog)) ) ;_ end of while (unload_dialog dcl_id) (princ) ) ;_ end of defun Quote Link to comment Share on other sites More sharing options...
cadfan Posted April 9, 2015 Author Share Posted April 9, 2015 if is your dialog file editbox is dcl ID "number" is the key for edit_box, or "th" of yours. *memory* is global default value (setq *memory* (if (and *memory* (= (type *memory*) 'STR)) *memory* "[b]0.000[/b]")) (defun c:test (/ dcl_id dd) (setq dcl_id (load_dialog [b][color="red"]<editbox.dcl>[/color][/b] ) dd 1) (while (or (not (numberp (read *memory*)))(= dd 1)) (new_dialog "[color="red"]editbox[/color]" dcl_id) (set_tile "[color="red"]number"[/color] *memory*) (action_tile "accept" "(setq *memory* (get_tile \"number\"))(done_dialog 0)") (setq dd (start_dialog)) ) ;_ end of while (unload_dialog dcl_id) (princ) ) ;_ end of defun Thank you very much , hanhphuc , I will study carefully! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.