Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP code syntax coloring in HTML
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00355687
Message ID:
00360905
Views:
31
Hi Mike,

Just found, that I need to include , in SYMBOLS
 #define SYMBOLS   ':;,./\<>+=-{}[]()#*'
 #define EMPTYLINE  '<P> </P>'
*Do some basic HTML intializing
 lcCode=strtran(lcCode,chr(9),space(5))
 lcCode=strtran(lcCode,'&','&')
 lcCode=strtran(lcCode,'<','<')
 lcCode=strtran(lcCode,'>','>')
 lcCode=strtran(lcCode,chr(10)+chr(13),chr(10)+chr(13)+chr(10)+chr(13))
>Hi Mike,
>
>Can not get it working too :( I tried to
>
> lcCode=strtran(lcCode,chr(10)+chr(13),chr(10)+chr(13)+chr(10)+chr(13))
,
>
>but it doesn't help :(...
>
>>>First of all, it doesn't insert blank lines (this is an easy fix, I have an idea)
>>
>>Take a look at my version early on in this thread Message#356055 , its always put in blank lines, but now I can't get it too, cuz the ALINES() just ignores blank lines. Try this:
>>
>>alines(aA, 'line1' + chr(13) + chr(10) + chr(13) + chr(10) + 'line3')
>>alines(aA, 'line1' + chr(10) + chr(10) + 'line3')
>>alines(aA, 'line1' + chr(13) + chr(13) + 'line3')

>>
>>Only the first command gives 3 lines, the last two give 2. Hmmm, maybe this is a difference from copying out of IE4 and IE5. Also, this is odd, I have this code in a PRG:
>>
>>
     endif
>>
>>     *Look at every RW
>>when I simply copy that to the clipboard and htmlcode.prg on the _cliptext, it does NOT respect blank lines, but if I copy that code into a tester1.prg, then do run htmlcode.prg on filetostr('tester1.prg') it works! So the fix is to basically strtran() the dumb things carraige returns and line feeds (you could also use a dummy text file with strtofile() then filetostr(), but it might be slower) so the line breaks are consitant for Alines().
>>
>>>we don't want to insert formatting tags in strings.
>>
>>I posted this as a problem way back when I first submitted the file. We've also talked about this. If you are going to do it at all, you might as well do it right, and, IMO, it is definatly not worth the performance lose. I say leave it the way it is. If you REALLY want to do this, I've already done it, we've already gone over this.
>
> Try to insert your code. I don't think it considerably slows the whole process. Right now it executes in 0.1 sec.
>>
>>>There is a one place in this program, which is not quite right... I mean, do I or I don't need to insert spaces between words...
>>
>>Can you explain? You mean the whole "<>()*&%#" or whatever thing? Yeah, you need that, thats was the idea that makes it work!
>
> Yes, but I'm not 100% sure, that my code does it right in all cases.
>
> Compare:
> upper(myString)
> upper( myString )
> upper (myString ),
> etc.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform