Hi, LMR!
What do you think is more readable and takes less time to understand, this:
symbol LED = 4 ' rename output4 'LED'
main: ' make a label called 'main'
readadc 0, b0
if b0 > 55 then
high LED ' LED on
pause 1000 ' wait 1 second (1000 ms)
low LED ' LED off
endif
wait 1 ' wait 1 second
goto main ' jump back to the start
or this:
1 symbol LED = 4 ' rename output4 'LED'
2
3 main: ' make a label called 'main'
4 readadc 0, b0
5 if b0 > 55 then
6 high LED ' LED on
7 pause 1000 ' wait 1 second (1000 ms)
8 low LED ' LED off
9 endif
10 wait 1 ' wait 1 second
11 goto main ' jump back to the start
Personally I would go for second variant as it is ten times more readable! LMR has rtf capabilities after all, why not to use it? So, here comes the problem: unfortunately Picaxe editor has no option to copy code as HTML, rtf, whatsoever... Let's fix this! :D
Ok, the workaround I found is not perfect and takes severall steps and some editing to complete, but I think sometimes it worth the time, especially if you are writing a tip or something alike.I hope this will be useful for somebody... Should we start?
Step 1. We will need a PDFCreator virtual printer. Print the code from Picaxe editor to this printer. You will get a PDF file with your code.
Step 2. Select and copy code from PDF.
Step 3. Paste it in any rtf enabled text processor. I have tried with MS Word and Sun Open Office, it works. Here you will need to do some editing as tabbing is lost. Setting font back to, say, Courier would be good as well....
Step 4. Copy nice looking code and paste it into your LMR post!
Step 5. Preview post. Sometimes you will have some font definitions or other artifacts appear after pasting from text processor. Make sure you preview post before posting and delete all undesired artifacts.
Done! :D Enjoy Picaxe syntax coloring on LMR!!!
PS. If you have other solutions to this problem, feel free to share them in comments, let's bring some colors in! :D