a little assistance please

Started by andrew, December 02, 2009, 09:45:58 AM

Previous topic - Next topic

owenwengerd

Andrew, I recommend to spend some learning how to debug your code with the VLIDE.  You can step through the code with the VLIDE to see where it is failing rather than changing things randomly in hopes that it will suddenly work.
Owen Wengerd (Outside The Box) / ManuSoft

andrew

Quote from: owenwengerd on December 03, 2009, 08:56:53 AM
Andrew, I recommend to spend some learning how to debug your code with the VLIDE.  You can step through the code with the VLIDE to see where it is failing rather than changing things randomly in hopes that it will suddenly work.

Owen, thanks for the help.

I ran the code alone thru vlide, and it works as it should.
but when i incorporate it into the odcl code it doesnt work

even when i use the following code in place of reading an external file it still dont list


(defun c:od-toolbox_Form1_OnInitialize (/ datafile ofile curline) 
  (setq datafile "c:\\test.txt") 
  (setq ofile (open datafile "r")) 
  (while (setq curline (read-line ofile)) 
    (setq file_content_list (cons curline file_content_list)) 
  ) 
  (close ofile) 
  (setq file_content_list (reverse file_content_list)) 
; (dcl_ListBox_AddList od-toolbox_Form1_ListBox1 file_content_list) 
  (dcl_ListBox_AddList od-toolbox_Form1_ListBox1 "hello" "world")
)

Kerry


The function expects a list

so, try
(dcl_ListBox_AddList od-toolbox_Form1_ListBox1 (list "hello" "world")  )
Perfection is not optional.
My other home is TheSwamp

Kerry

Try something like this for debugging..

Note I've added the findfile
(setq datafile (findfile "c:\\test.txt"))

Recording set to run once.  F5 refresh to replay.

Perfection is not optional.
My other home is TheSwamp

andrew

yep mine works the same way
???

here are my files can you run them and tell me if they work for you?

BazzaCAD

You don't have the "Initialize" event checked on your form.
Remember to save your project after you do..
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

andrew

Quote from: BazzaCAD on December 03, 2009, 11:23:38 AM
You don't have the "Initialize" event checked on your form.
Remember to save your project after you do..


wow that was simple heh

thanks everyone for the help