Author Topic: Populating ListBox  (Read 5250 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
Populating ListBox
« on: May 01, 2007, 04:34:17 PM »
I can't seem to get a ListBox filled with the current views within the drawing.   The code is below.  What am I doing wrong?  Maybe I'm just having a brain-fade.

Code: [Select]
(DEFUN C:TOOLBOX (/ fn)
    (SETQ sVariable "Not set")
    ;;
    ;; Ensure the OpenDCL.##.ARX is loaded.
    (OR (VL-SYMBOL-VALUE 'ODCL_GETVERSIONEX)
        (AND (SETQ fn (FINDFILE "OpenDCL_ARXLoader.LSP"))
             (LOAD fn (STRCAT "Failed to load :- " fn))
        )
        (ALERT (STRCAT "Failed to load OpenDCL_ARXLoader.LSP"))
        (EXIT)
    )
    ;;
    ;; Ensure the Project ODC file is loaded.   
    (OR (ODCL_PROJECT_LOAD "Toolbox") (EXIT))
    ;;
    ;; Show the modal dialog .. (odcl_Form_IsActive test is not required
    ;;
    (ODCL_FORM_SHOW Toolbox_frmMain)
    (LoadViews)
    (PRINC)
)

(defun LoadViews ( / strViewName strViewList)
   (setq strViewList (GetNames "VIEW"))
   (Odcl_ListBox_AddList Toolbox_frmMain_lstViews StringList strViewList)
   (princ)
)

(defun GetNames ( TableName / Data Result )
   (while (setq Data (tblnext TableName (null Data)))
      (setq Result (cons (cdr (assoc 2 Data)) Result))
   )
)

(princ)

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Populating ListBox
« Reply #1 on: May 01, 2007, 04:41:53 PM »
(Odcl_ListBox_AddList Toolbox_frmMain_lstViews strViewList)
James Buzbee
Windows 8

Guest

  • Guest
Re: Populating ListBox
« Reply #2 on: May 01, 2007, 04:42:43 PM »
I knew it was something stupid-simple.  Thanks!

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Populating ListBox
« Reply #3 on: May 01, 2007, 04:55:28 PM »
only because I've made the same mistake myself  :lol:
James Buzbee
Windows 8

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Populating ListBox
« Reply #4 on: May 01, 2007, 08:43:17 PM »
^^ ditto.

:-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Guest

  • Guest
Re: Populating ListBox
« Reply #5 on: May 02, 2007, 08:27:37 AM »
The funny thing is, it didn't throw any kind of error.  :?

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Populating ListBox
« Reply #6 on: May 02, 2007, 08:57:51 AM »
(Odcl_HideErrorMsgBox)?
James Buzbee
Windows 8

Guest

  • Guest
Re: Populating ListBox
« Reply #7 on: May 02, 2007, 09:55:51 AM »
(Odcl_HideErrorMsgBox)?
                                                       ^ ^ ^ ^
I don't have that anywhere in my code. See above.