Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Quick Way to Use mhHTMLCode
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00478135
Message ID:
00478886
Views:
25
>Like many of us, I really enjoy using Mike Helland's mhHTMLCode utility, which turns ordinary VFP code into syntax-colored HTML for posting on the Web. (If you haven't discovered this yet, it's available for download here on the UT.) Mike has also provided a slick online interface for this, which you can find at http://24.14.98.235/htmlcode.asp.
>
>There are times when I'd like to have a quick desktop interface to mhHTMLCode, though. The idea would be to allow you to copy your VFP code into the clipboard, run mhHTMLCode from the VFP Tools menu, and then paste the results back from the clipboard - quick and easy. So, here's one way to do that.
>
>The code below assumes that mhHTMLCode is in C:\VFPTools\mhHTMLCode\. Change it to correspond to where mhHTMLCode is on your machine.
>
>1) Place a wrapper prg (I called it mhHTMLCodeCaller.prg) in the same directory as mhHTMLCode.prg. The wrapper prg looks like this:
>
>local lcPath
>lcPath = set("path")
>set path to ( lcPath) + ";c:\vfptools\mhhtmlcode\" && use your own folder name
>_cliptext = mhHTMLCode( _cliptext)
>set path to ( lcPath)
>2) In vfpstart.prg (or whatever command file you call on VFP startup), put this code (the menu location and bar # are up to the you):
>
>*	Mike Helland HTML Code Colorizer
>DEFINE BAR 597 OF _mtools PROMPT "mhHTMLCode" BEFORE _mtl_sp200
>ON SELECTION BAR 597 OF _mtools DO \VFPTools\mhHTMLCode\mhHTMLCodeCaller.prg
>Hope you find it useful. And of course, thanks to Mike for making this great little utility available in the first place.

Rick,

This is my VFPStart program. I would adjust it to use your wrapper (currently I modified mhHTMLCode the same way, as Jonathan).
********************************************************************
*  Description.......: Startup program for Visual FoxPro
*  Calling Samples...:
*  Parameter List....: tcUtilityPath
*  Created by........:
*  Modified by.......: Nadya Nosonovsky 10/25/2000 10:27:26 AM
********************************************************************
lparameters tlcUtilityPath
*** Allows customization of Utility path locations.  Can be passed by config.vp6 at
*** startup
if vartype(tcUtilityPath) # 'C'
     tcUtilityPath = "D:\Utilities\"
endif
tcUtilityPath = upper(addbs(tcUtilityPath))
local lcTemp
if not "FOXTOOLS.FLL" $ upper(set("library"))
     set library to home()+'Foxtools.fll' additive
endif
* Insert description (title)
lcTemp = tcUtilityPath + "InsertDesc\InsertDesc WITH '" + tcUtilityPath + "InsertDesc\'"
on key label F7 do &lcTemp

* John Koziol utiltiy to list table structure
lcTemp = tcUtilityPath + "ListStructure\ls"
on key label F8 do &lcTemp with .t.
* Insert modidate
on key label f3 keyboard 'Nadya Nosonovsky '+ttoc(datetime()) plain && Insert modidate
local lcTemp2

* WEB nice formatting (Nadya Nosonovsky version)
*ON KEY LABEL F9 _Cliptext=nnHTMLcode(_cliptext)
lcTemp = tcUtilityPath + "HTMLCODE\nnHTMLCode"
on key label F9 do &lcTemp

* WEB nice formatting (Mike Helland version)
*ON KEY LABEL F10 _ClipText = mhHTMLCode(_ClipText)
lcTemp = tcUtilityPath + "HTMLCODE\mhHTMLCode"
on key label F10 do &lcTemp

on key label F12 activate window debug && Debug should be available
********* EView - Erik Moore EView - very powerful tool for manipulating with views
local lnBar, lnBarHlp
lnBar = cntbar('_MTOOLS') + 1
define bar lnBar of _MTOOLS prompt "\-"
lnBar=lnBar+1
define bar lnBar of _MTOOLS prompt "EView..."
lcTemp = tcUtilityPath + "eView\eView"
on selection bar lnBar of _MTOOLS do &lcTemp
*on selection bar lnBar of _MTOOLS do tcUtilityPath+'EView\eview.app' && EView app
lnBar = cntbar('_MTOOLS') + 1
define bar lnBar of _MTOOLS prompt "\-"
lnBar=lnBar+1
define bar lnBar of _MTOOLS prompt [ClassBrowser...]
on selection bar lnBar of _MTOOLS do (_browser) with getfile('Files:VCX')

lnBar = cntbar('_MTOOLS') + 1
define bar lnBar of _MTOOLS prompt "\-"
lnBar=lnBar+1
define bar lnBar of _MTOOLS prompt "Searc\<h a string..."
lcTemp = tcUtilityPath + "SearchString\SearchString"
on selection bar lnBar of _MTOOLS do &lcTemp

******* Hacker's Guide by Tamar Granor ************************************
lnBarHlp = cntbar('_MSM_SYSTM') + 1
define bar lnBarHlp of _msm_systm prompt "\-"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "Hackers Guide" key alt+F1
lcTemp = 'DO ' + tcUtilityPath + 'FoxToolsHelp\HackFox WITH "' + tcUtilityPath + ;
     'FoxToolsHelp\"'
on selection bar lnBarHlp of _msm_systm &lcTemp
*on key label ALT+F1 &lcTemp
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "\-"
lnBarHlp=lnBarHlp+1
*********** George Tasker FoxTools Help ****************
define bar lnBarHlp of _msm_systm prompt "FoxTools Help" key shift+F1
lcTemp = 'DO ' + tcUtilityPath + 'FoxToolsHelp\ToolHelp WITH "' + tcUtilityPath + ;
     'FoxToolsHelp\"'
on selection bar lnBarHlp of _msm_systm &lcTemp

*!*     on selection bar lnBarHlp of _msm_systm do tcUtilityPath+'FoxToolsHelp\ToolHelp.prg' ;
*!*          with tcUtilityPath

*********************  Added Help for On keys defined above ********
*** This way I could hit help menu and see key definitions
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "\-"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F3 = Insert Date & Modified By"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F7 = Insert Description Header"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F8 = List Structure"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F9 = Nadya HTML to clipboard"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F10 = Mike Heland HTML to clipboard"
lnBarHlp=lnBarHlp+1
define bar lnBarHlp of _msm_systm prompt "F12 = Activate Debug window"
lnBarHlp=lnBarHlp+1

_screen.icon='d:\redp\appl\commonwg\bmps\wlogo.ico' && Change screen icon
_screen.caption=space(20)+'My wonderful VFP SP4  '+ ;
     space(50)+' '+cmonth(date())+ ;
     ' '+alltrim(str(day(date())))+', ' ;
     +alltrim(str(year(date())))
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform