PDA

View Full Version : List Files


bengle
2007-06-21, 01:02 AM
In a dialog box file you use // to place information in the file and the same in the old menu files.

How do you place information in a lisp list file that is not be read or crashes lisp routine.

Opie
2007-06-21, 05:59 AM
Use the semi-colon (;) for comments.

abdulhuck
2007-06-21, 06:53 AM
Also a combination of semicolumn and pipe symbol (|) if you need to comment in between a line of code or a block of multi-line comments. See various combinations


(defun c:hello (/ test next)
(setq test ;|set up test variable|; "Hello")
(setq next ;| this variable..........
........................
........................
........................|; " World")
(princ (strcat test next)) ; prints the output
(princ)
)
; end of the code


Regards,
AH

bengle
2007-06-21, 03:17 PM
The semi-colon (;) work in the Lisp routine it self but, not in a list file being read by the Lisp.

IE.

;Size Depth Web Width Flange K
("I 8x6.510" 8.00 0.27 4.00 0.27 0.52)
("I 6x5220" 6.00 0.343 3.443 0.343 0.593)
("I 6x4.421" 6.00 0.23 3.33 0.23 0.48)

Opie
2007-06-21, 04:01 PM
The semi-colon (;) work in the Lisp routine it self but, not in a list file being read by the Lisp.

IE.

;Size Depth Web Width Flange K
("I 8x6.510" 8.00 0.27 4.00 0.27 0.52)
("I 6x5220" 6.00 0.343 3.443 0.343 0.593)
("I 6x4.421" 6.00 0.23 3.33 0.23 0.48)
Then your program will need to do some checking of the data prior to placing it in your lists.

abdulhuck
2007-06-21, 05:00 PM
...but, not in a list file being read by the Lisp.

Sorry for not reading your post properly. I think you can add if statement and only work your code when the first character in the list file is not a semicolumn (or any character you wish to use for comment).


(setq inText(read-line YourListFile))
(if (/= (substr inText 1 1 ) ";"")
(ProceedWithYourCode)
(); else ignore that line
)


If you post your code here, somebody may be able to help you out.

Regards
AH