I have identical lisp routines on two different machines - one works and the other does not. The READ-LINE command is returning nil where there is text...I am stumped.
I have identical lisp routines on two different machines - one works and the other does not. The READ-LINE command is returning nil where there is text...I am stumped.
Is it finding the file on both machines?
Maybe posting the code will help, and the locations of both text files per each computer.
Tim
The source files are on the desktop in both cases. Excerpt from code:
(setq sf (open "sec.mpr" "r"))
(repeat 5 (read-line sf))
(setq minx (substr (read-line sf) 26))
It crashes when it gets to the substr command.
From the computer that doesn't work do a
(findfile "sec.mpr")
and see what it returns.
Tim
The file that it should be reading is on the desktop. I have many more of these files in other directories as I have been using this code without problem for some time now which is what really drives me crazy.
Try hard coding the path to the desktop then, and see it that works. Only thing I can think of is that it's not finding the right file so there is nothing to read.
Tim
This is like a bad dream. Here is the new code:
(setq sf (open "C:\Documents and Settings\Administrator\Desktop\sec.mpr" "r"))
(repeat 5 (read-line sf))
(setq minx (substr (read-line sf) 26))
Here are the contents of C:\Documents and Settings\Administrator\Desktop\sec.mpr:
---------------- REGIONS ----------------
Area: 0.8421
Perimeter: 11.9980
Bounding box: X: 73.5967 -- 75.5087
Y: 136.7406 -- 140.0526
Centroid: X: 74.8405
Y: 138.2646
Moments of inertia: X: 16098.9422
Y: 4716.7731
Product of inertia: XY: 8713.8909
Radii of gyration: X: 138.2678
Y: 74.8419
Principal moments and X-Y directions about centroid:
I: 0.1220 along [0.2807 0.9598]
J: 0.8014 along [-0.9598 0.2807]
??????????????????? Thanks anyhow.
I cut/pasted what you had into a text file on my desktop, selected that file with getfiled. Your code seemed to work, but minx was set to "". Sorry can't duplicate your problem here.
Tim
I modified the code to include all file extensions in file names and it seems to run fine now.
Thanks and happy holidays.
I don't know what I did, but I'm glad you got it to work for you.
Happy Holidays.
Tim
;;You must waiting!!
(defun WAIT (SECONDS / STOP)
;;
;; Posted by Tony Tanzillo
;; Creates a pause in your program flow
;; This function provides for much finer
;; increments in time then the command DELAY
;;
(setq STOP (+ (getvar "DATE") (/ SECONDS 86400.0)))
(while (> STOP (getvar "DATE"))
(princ)
)
)
(while (or (= (setq FILE (findfile "sec.mpr")) NIL)
(progn (setq FIB (open FILE "r"))
(setq NR (read-line FIB))
(close FIB)
(not NR)
)
)
(WAIT 0.01)
)
"T.Willey" <nospam@address.withheld> ¦b¶l¥ó
news:16313191.1103831260841.JavaMail.jive@jiveforu m1.autodesk.com ¤¤¼¶¼g...
I don't know what I did, but I'm glad you got it to work for you.
Happy Holidays.
Tim
the need to read
Insert a Cell on an angled line, and have the line break - a
Insert a Cell on an angled line, and have the line break - a