Author Topic: Help  (Read 1579 times)

0 Members and 1 Guest are viewing this topic.

myloveflyer

  • Newt
  • Posts: 152
Help
« on: March 12, 2010, 08:02:26 PM »
In the program execution when the first two times the previous record of how to input the value of the dialog box.
Global variables or other?
« Last Edit: March 13, 2010, 02:19:46 AM by myloveflyer »
Never give up !

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Help
« Reply #1 on: March 13, 2010, 07:05:36 AM »
Are you asking how to keep values in a dialog box?

This could be done using Global variables, a cfg/txt file, the registry etc..

mkweaver

  • Bull Frog
  • Posts: 352
Re: Help
« Reply #2 on: March 15, 2010, 07:01:34 AM »
In the program execution when the first two times the previous record of how to input the value of the dialog box.
Global variables or other?

Global variables work fine if you don't need to keep the values from session to session, otherwise, you might consider setenv and getenv.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Help
« Reply #3 on: March 15, 2010, 07:33:51 AM »
If you  use Globals be sure to give them distinct names so they don;t clash with other programs
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

myloveflyer

  • Newt
  • Posts: 152
Re: Help
« Reply #4 on: March 16, 2010, 04:10:03 AM »
Thanks, after a friend pointing, I would be handled this way:
The friend knew there any easier way to deal with such a procedure!
(defun test_dcl()
(setq dcl_id (load_dialog "tt_dcl"));载入DCL文件
(if (< dcl_id 0) (exit))
(if (not (new_dialog "tt_dcl" dcl_id)) (exit));
(or $GUOJUN-tt222$ (setq $JUNJUN-tt222$ "20"))
(set_tile "tt222" $GUOJUN-tt222$)
...
(action_tile "accept" "(s_rect)(done_dialog 1)")
(action_tile "cancel" "(T(exit))")
(start_dialog)
(unload_dialog dcl_id)
)

(defun s_rect ()  
(setq tt (atof (get_tile "tt222"))
...
)
(setq $JUNJUN-tt222$ (get_tile "tt222")
...
)
 )

« Last Edit: March 16, 2010, 04:13:12 AM by myloveflyer »
Never give up !

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Help
« Reply #5 on: March 16, 2010, 11:26:30 AM »
I wouldn't use:

Code: [Select]
(t (exit))

For the cancel action_tile... just use (done_dialog 0) and check for the return of start_dialog - much cleaner that way  :-)