PDA

View Full Version : Fonts for the code lines



fuccaro
11th Oct 2003, 10:19 am
CADTutor
Occasionally I post lisp routines in this Forum. I write the text on my computer using the visual lisp editor. If a lisp command contains an other command on a new line, the second line is indented at right. This is a facility of the text editor and it is a good thing. Whenever I place comments after a program line, I use the same number of TABs from the beginning of the line so the comments are vertically aligned. But when I post the routines in the Forum, the alignment (for both the commands and for the comments) is lost.
Do you think it would be possible to use a non-proportionally spaced font for the text style used for display the code lines? I think this is the origin of the ...problem.
Well, it is not really a problem -however, can you help?

superjari
11th Oct 2003, 10:46 am
I think PHPBB doesn't support tabs...

Let's try this out now...

(I used tabs between the words above...

CADTutor
11th Oct 2003, 10:27 pm
Unfortunately, formatting support within phpBB is rather limited when using only BBCode. As administrator I have the option to enable HTML for posts which yould give users greater control over formating. Unfortunately, there are a number of security issues that result from this and so I have decided against it for the moment. There will be a new version of phpBB along in the not too distant future with lots of new features and improved security. I might be inclined to enable HTML after an upgrade but for now I guess you'll have to do without the indented code.

Your code is beautiful in any case, I wouldn't worry too much :D

Flores
12th Oct 2003, 12:16 am
Why not use the Visual Lisp Editor that comes with ACAD 2K and higher? I'll admit that it was unstable in 2K, but in 2Ki and higher, it has improved and doesn't crash as often as before. (Type "vlide" or "vlisp" at the command line)
I was wondering if using the BBCode "Code" syntax would keep it from not recognizing tabs, but I guess it just prevents it from word wrapping. The routine below has tabs, but it also has auto-formatting from VLide, and the tabs were not recognized.



;|
zt.lsp
Zooms in and trims, then zooms out
|;

(defun c:zt (/ p1 p2 a)
(setq oom (getvar "orthomode") ; old orthomode
noom (setvar "orthomode" 0) ; new orthomode
var ""
p1 (getpoint "\n1st point: ") ; point 1
p2 (getpoint p1 "\n2nd point: ") ; point 2
)
(command "ZOOM" "W" p1 p2)
(while (= var "")
(command "TRIM" "C" p1 p2 "" pause "")
&#40;setq var &#40;getstring "\nContinue TRIM? Yes &#40;Enter&#41; <N>&#58; "&#41;&#41;
&#41;
&#40;command "ZOOM" "P"&#41;
&#40;princ&#41;
&#41;
&#40;prompt "To use, enter zt at the command line."&#41;
&#40;princ&#41;


Flores

fuccaro
13th Oct 2003, 05:57 am
This is the point, Flores: the comments are not aligned.
Well, it is just a minor problem and the life will go on!