FoxPro Programming
Visual Foxpro - Execute Java Script
Gravatar is a globally recognized avatar based on your email address. Visual Foxpro - Execute Java Script
  Edward K. Marois
  All
  Aug 30, 2022 @ 11:37am

Dear Rick:

Thanks for all the help you have been in the Past.

I have finally received permission to look into accessing the Web based product called 'Plaid' which is Java based.

Shockingly, I have a Java Based Web site up and running and have some Java skills.

As you may recall, our product is written in Visual Foxpro and running locally.

The question I have for you is how to best execute 'Java' from within Visual Foxpro so that it appears seamless.

I could use your code sample


oBrowser = CREATEOBJECT("InternetExplorer.Application")
obrowser.Visible = .t.
oBrowser.Navigate("C:\wwapps\Conf\FoxWebServices\FoxCode\html\_preview.htm"

If I can get this working, I would populate a ".htm" file with what I want to do and then execute it.

Though a solution, this causes a number of concerns

Thus, is there a way to execute java without having to open a browser.

I have a feeling that your going to suggest using the .NET bridge and if so I would appreciate an example

If NOT then a example of your suggested solution would be most appreciated.

Also

The proposed solution to the security issue as you might have guessed is to download the transaction information off the web and process everything locally.

What do you think ???

Edward K. Marois - Realty Information Systems.

Gravatar is a globally recognized avatar based on your email address. re: Visual Foxpro - Execute Java Script
  Bob Roenigk
  Edward K. Marois
  Sep 1, 2022 @ 02:03pm

Edward, I am mostly guessing at this suggestion that might point you in some direction. Have you investigated the MSScriptcontrol class?

This is not tested but something along these lines?

oJava = Createobject([MSScriptcontrol.scriptcontrol])
oJava.Language = [Javascript]
lcScript = filetostr("c:\yourscriptfile.txt")
oJava.ExecuteStatement(lcScript)

~bob

Gravatar is a globally recognized avatar based on your email address. re: Visual Foxpro - Execute Java Script
  Rick Strahl
  Bob Roenigk
  Sep 2, 2022 @ 10:01am

While that might work, keep in mind that that's a really old version of JavaScript. If using any modern JS code that's likely to fail as that is based on an old version of JavaScript that ran in IE6.

+++ Rick ---

© 1996-2025