AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN




	: list_box {
          action alignment allow_accept fixed_height
          fixed_width height is_enabled is_tab_stop
          key label list mnemonic multiple_select
          tabs value width

DCL Coding: 
lisp48i : dialog {				//dialog name
          label = "list_box" ;			//give it a label

     	: list_box {				//define list box
        key = "selections";			//give it a name
        }					//end list

        ok_cancel ;				//predefined OK/Cancel button

        }					//end dialog 

AutoLisp Coding: 
(defun C:lisp48i ()
;define function	

  (setq NAMES '("Monday" "Tuesday" "Wednesday" "Thursday"
                "Friday" "Saturday" "Sunday")
  ;define list

  (setq dcl_id (load_dialog "lisp48i.dcl"))
  ;load dialog

  (if (not (new_dialog "lisp48i" dcl_id)
  ;test for dialog


    ;exit if no dialog


  (start_list "selections")
  ;start the list box

  (mapcar 'add_list NAMES)
  ;fill the list box

  ;end list

    ;if O.K. pressed

    ;string 'em together

      (setq SIZ (atof (get_tile \"selections\")))"
      ;get list selection

      "(done_dialog) (setq userclick T))"	
      ;close dialog


  );action tile

    ;if cancel button pressed

    "(done_dialog) (setq userclick nil)"	
    ;close dialog


  ;start dialog
  (unload_dialog dcl_id)

   (if userclick
   ;check O.K. was selected

    ;if it was do the following

      (setq SIZ (fix SIZ))
      ;convert to integer

      (setq SIZ (nth SIZ NAMES))
      ;get the Day

      (alert (strcat "You Selected: " SIZ))			
      ;display the Day


  );if userclick



The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website