Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP code syntax coloring in HTML
Message
 
 
To
05/04/2000 22:52:29
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00355687
Message ID:
00356200
Views:
22
As my 5-year-old daughter would say, "Cooool beans!!!" So how will it handle menu hot keys? e.g. \ < [without the space of course].

>This maybe closer to what your getting at, I didn't add any lines, just changed the condition of the DO WHILE:
>
>
>lparameters lcCode, lcPath
>
>*Open up our table of words
>lnWA = select()
>select 0
>use (iif(empty(lcPath), '', lcPath) + 'words')
>
>*Do some basic HTML intializing
>lcCode = strtran(lcCode, chr(9), space(5))
>lcCode = strtran(lcCode, '&', '&amp;')
>lcCode = strtran(lcCode, 'lcCode = strtran(lcCode, '>', '&gt;')
>
>*Create an array ouf of our strings.
>local laLines[1], lcReturn
>alines(laLines, lcCode)
>lcReturn = ''
>
>*Proccess each line
>for lnI = 1 to alen(laLines)
>
>     lcLine = laLines[lnI]
>
>     *Don't even bother the blank ones
>     if empty(alltrim(lcLine))
>          lcReturn = lcReturn + chr(13) + chr(10)
>          loop
>     endif
>
>     *Full Line Comments, first
>     if upper(alltrim(lcLine)) = '*' or;
>          upper(alltrim(lcLine)) = 'NOTE'
>          lcLine = '' + ;
>               lcLine + ''
>
>          *Print line here
>          lcReturn = lcReturn + chr(13) + chr(10) + lcLine
>          loop
>     endif
>
>     *Define vars ahead of time
>     *So they do not always need to be
>     *Calculated in the loops
>     local lcFormat, lnFormatLength, lcFL, ;
>          lcRW, lnRWLength, lnStartRW, lnOccurance
>     lcFormat = ''
>     lnFormatLength = len(lcFormat)
>     lcFL = ' '+ upper(trim(chrtran(lcLine, ':;./\+=-}]()#', space(15)))) + ' '
>
>     *Now end of the line comments
>     local lcDoubleAmp, lnStartComment
>     lcDoubleAmp = '&amp;&amp;' &&This is to test our function
>     lnStartComment = at(lcDoubleAmp, lcLine)
>     if lnStartComment > 0
>          lcLine = stuff(lcLine, lnStartComment, 0, '') + ;
>               ''
>     endif
>
>     *Look at every RW
>     scan
>          wait window nowait 'Line ' + alltrim(str(lnI)) + ;
>               '  RW ' + alltrim(str(recno()))
>          lcRW = ' ' + alltrim(REVWORD) + ' '
>          lnRWLength = len(lcRW) - 2
>
>          *For each occurance of an RW ...
>          lnOccurance = 1
>          lnStartRW = at(lcRW, lcFL, 1)
>          do while lnStartRW > 0 and (lnStartComment = 0 or lnStartRW 
>               *Put in the format tags
>               lcLine = stuff(lcLine, lnStartRW, 0, lcFormat)
>               lcLine = stuff(lcLine, lnStartRW + lnFormatLength + lnRWLength, 0, '')
>               lcFL = ' '+ upper(trim(chrtran(lcLine, ':;./\+=-}]()', space(14)))) + ' '
>
>               lnOccurance = lnOccurance + 1
>               lnStartRW = at(lcRW, lcFL, lnOccurance)
>          enddo
>     endscan
>
>     *Submit the process line
>     lcReturn = lcReturn  + chr(13) + chr(10) + lcLine &&Another InLine Test to use
>endfor
>lcReturn = lcReturn  + '
'
>
>use
>select (lnWA)
>
>return lcReturn
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform