0 Members and 1 Guest are viewing this topic.
<td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_002.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_002.jpg' width=100 height=75 border=0></a><br>002</td>
Yep, but why use lisp?
(defun c:Test ( / rset foo main ) (defun rset ( text padding maxlen ) (substr ( (lambda ( ) (while (< (strlen (setq padding (strcat padding padding))) maxlen ) ) (setq text (strcat padding text)) ) ) (- (strlen text) (1- maxlen)) ) ) (defun foo ( integer / integerAsPaddedString ) (strcat "<td>" "<a href='http://home.comcast.net/~dominic.cesare" "/pictures/Louisville/Louisville_" (setq integerAsPaddedString (rset (itoa integer) "000" 3)) ".jpg' title='Click to enlarge'>\n" "<img src='http://home.comcast.net/~dominic.cesare" "/pictures/Louisville/Louisville_" integerAsPaddedString ".jpg' width=100 height=75 border=0></a>\n" "<br>" integerAsPaddedString "</td>\n" ) ) (defun main ( / i ) (setq i 0) (repeat 51 (princ (foo (setq i (1+ i)) ) ) ) (princ) ) (main) )
<td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_014.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_014.jpg' width=100 height=75 border=0></a><br>014</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_015.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_015.jpg' width=100 height=75 border=0></a><br>015</td>
Glad to hear D2H. Just let me know if / when you need another nudge.
I might will need some help...maybe
Quote from: Dommy2Hotty on November 17, 2005, 10:09:08 AMI might will need some help...maybeExtra carriage returns, writing output to file ... ??Let me know what and I'll try to help.
<tr valign=top align=center><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_002.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_002.jpg' width=100 height=75 border=0></a><br>002</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_003.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_003.jpg' width=100 height=75 border=0></a><br>003</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_004.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_004.jpg' width=100 height=75 border=0></a><br>004</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_005.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_005.jpg' width=100 height=75 border=0></a><br>005</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_006.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_006.jpg' width=100 height=75 border=0></a><br>006</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_007.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_007.jpg' width=100 height=75 border=0></a><br>007</td></tr><tr valign=top align=center><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_008.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_008.jpg' width=100 height=75 border=0></a><br>008</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_009.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_009.jpg' width=100 height=75 border=0></a><br>009</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_010.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_010.jpg' width=100 height=75 border=0></a><br>010</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_011.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_011.jpg' width=100 height=75 border=0></a><br>011</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_012.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_012.jpg' width=100 height=75 border=0></a><br>012</td><td><a href='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_013.jpg' title='Click to enlarge'><img src='http://home.comcast.net/~dominic.cesare/pictures/Louisville/Louisville_013.jpg' width=100 height=75 border=0></a><br>013</td></tr>
(defun C:TryThis ( / replace lset main ) (defun replace ( oldText newText text / i ) (if (/= oldText newText) (while (setq i (vl-string-search oldText text)) (setq text (vl-string-subst newText oldText text i ) ) ) ) text ) (defun rset ( text padding maxlen ) (substr ( (lambda ( ) (while (< (strlen (setq padding (strcat padding padding))) maxlen ) ) (setq text (strcat padding text)) ) ) (- (strlen text) (1- maxlen)) ) ) (defun main ( / header placeholder body footer imagecount groupcount result i ) (setq header '("<tr valign=top align=center>\n\n")) (setq placeholder "[PLACEHOLDER]") (setq body (list "<td>" "<a href='" "http://home.comcast.net/~dominic.cesare" "/pictures/Louisville/Louisville_" placeholder ".jpg'" " title='Click to enlarge'>\n" "<img src=" "'http://home.comcast.net/~dominic.cesare" "/pictures/Louisville/Louisville_" placeholder ".jpg'" " width=100 height=75 border=0></a>\n" "<br>" placeholder "</td>\n\n" ) ) (setq footer '("</tr>\n\n")) (setq i 0 imagecount 10 groupcount 6 result (list header) ) (repeat imagecount ( (lambda (body) (setq result (cons body result ) ) (if (zerop (rem i groupcount)) (setq result (cons header (cons footer result ) ) ) ) ) ( (lambda ( / paddedindex ) (setq paddedindex (rset (itoa (setq i (1+ i))) "00" 3 ) ) (mapcar '(lambda (item) (replace placeholder paddedindex item ) ) body ) ) ) ) ) (setq result (apply 'append (reverse (if (eq footer (car result)) result (cons footer result) ) ) ) ) ;; I'm just going to print the data to the ;; screen, if you want you could take the ;; result and write it to a file (mapcar 'princ result) (princ) ) (main))
My pleasure, hic.