craigsboyd
IS-IT--Management
Just a quick and dirty way to execute VBScript or JScript (Javascript) from within VFP using the Microsoft Script Control. Opens up some possibilities for extending VFP. Below is a very simple example using VBScript. I kept it simple on purpose so members could easily see the basic way this works. Cut-n-paste the code below into a prg file and run it from within VFP.
Slighthaze = NULL
[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
Code:
Local lcBegin, lcEnd, loScript, lcVBScriptCode
lcBegin = [Sub ShowMyMessage] + Chr(10) + Chr(13)
lcVBScriptCode = [MsgBox "VBScript was just executed and this is the resulting message box!"]
lcEnd= Chr(10) + Chr(13) + [ End Sub]
lcVBScriptCode = lcBegin + lcVBScriptCode + lcEnd
loScript = Createobject([MSScriptcontrol.scriptcontrol.1])
loScript.Language = [VBScript]
loScript.AddCode(lcVBScriptCode)
loScript.executestatement("ShowMyMessage")
Slighthaze = NULL
[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]