Load a webpage into a dialogbox

Started by bmclellan, April 18, 2023, 11:27:50 AM

Previous topic - Next topic

bmclellan

I couldn't figure this out, so I thought I'd ask chatGPT about it.

While it does not work, I was impressed that it gave it a shot!

----------------------------
Me:> in winbatch how would you load an iframe into a dialogbox
----------------------------

In WinBatch, you can load an iframe into a dialog box using the CreateDialog function to create the dialog box, and the HtmlControlLoad function to load the iframe into an HTML control. Here's an example code:

; Define the dimensions of the iframe
nWidth = 500
nHeight = 300

; Create the dialog box
hDlg = CreateDialog(0, "Sample Dialog", 0, 0, nWidth, nHeight)

; Create an HTML control for the iframe
hHtml = HtmlControlCreate(hDlg, "Iframe", "", 10, 10, nWidth-20, nHeight-20)

; Load the iframe URL into the HTML control
HtmlControlLoad(hHtml, "https://www.example.com")

; Show the dialog box
DialogShow(hDlg)

-----
In this example, the CreateDialog function creates a dialog box with a title of "Sample Dialog" and the dimensions specified by nWidth and nHeight.

The HtmlControlCreate function creates an HTML control within the dialog box at the specified coordinates (10, 10) and with the dimensions specified by nWidth-20 and nHeight-20 (to leave a margin of 10 pixels on each side).

Finally, the HtmlControlLoad function loads the URL of the iframe into the HTML control, and the DialogShow function shows the dialog box with the loaded iframe.

You can save this code in a file with the extension ".wbt" (for example, "iframe.wbt"), and then run it by double-clicking on the file. This will open a dialog box with the specified iframe URL loaded inside.

JTaylor

As far as I can tell ChatGPT acts like it knows what WinBatch is but doesn't really seem to have a clue.   Tony needs to send it the documentation.

Sorry but I am being lazy.  This is something from several years ago.  It works and shows one way to load a web page but does have extra stuff.   Just ask if it isn't clear on the part you need.

Jim


bmclellan

This is fantastic, thanks so much for some sample code!!

I'll give it a shot and see how I make out.

Thank you!

td

I was bored and need a laugh so I typed in a statistical analysis coding question specifically requesting a C++ solution into OpenAI's chatGPT 4 website prompt. Since I had already written a C++ solution I thought it interesting to see if a probability/pattern-matching algorithm like cantGPT could do any better. While it did turn out some overly busy but possibly usable source code, it was written in Python instead of C++.  Perhaps the developers at OpenAI are Python fanboys or something?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

I'm amazed that it produces winbatch code if asked, and even fixing it when prompted to. Not that it's useful for that purpose, but it says something about how it works -- that it's able to make a decent guess about syntax for a, let's admit, not-so-popular computer language. 

It is, I guess, a *language* model, so maybe these computer languages are enough like human language... 

Just wish the darn thing didn't lie so adroitly.
The mind is everything; What you think, you become.

kdmoyers

I saw the same preference for python.  I asked it for help with some physics the other day and the solution was non linear so it whipped out a little python code to solve it numerically.  It seems to have python libraries it prefers to use for this purpose.
The mind is everything; What you think, you become.

stanl

I installed the PS GPT module. It does pretty well writing PS code, and was useful with my struggles with RegEx.

td

Quote from: kdmoyers on April 20, 2023, 05:01:18 AM
I saw the same preference for python.  I asked it for help with some physics the other day and the solution was non linear so it whipped out a little python code to solve it numerically.  It seems to have python libraries it prefers to use for this purpose.

The reason the software can produce WIL scripts at all is that the tech bros' underlings scrapped sights with WinBatch scripts (there are more than you may think) to feed into it for training. I worked on an AI project in the '90s. The only differences now are that some Indian mathematician wrote a proof that you can layer neuronets and the hardware has gotten a lot better. I guess the one thing that impresses me is the overblown hype surrounding Chat GPT and its ilk. I believe even the man behind OpenAI has much more eloquently expressed similar thoughts.

Python is the most popular programming language out there so I suppose it makes a good default choice. There has been some thought given to writing a WIL extender that allows the use of Python modules in WIL scripts. Or maybe we should write and train our own AI model to write WIL scripts...
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Quote from: td on April 20, 2023, 07:45:29 AM
Or maybe we should write and train our one AI model to write WIL scripts...

There is a chat GPT extension for VS code and a user on this forum submitted code for a WB extension. So I guess you could load a WB script and chat with it.

td

ChatGPT is an LLM. Obviously, what I had in mind was something more focused, single purpose, and maybe even useful. I have been using AI software for several years to help with long-form writing. Not to generate content but to identify awkward sentences and offer synonyms for tired clichés. As anyone who has spent much time on this forum will attest, I need all the help I can get in that area.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

Had to ask GBT what an LLM is.... pretty sure your meaning is a far cry ;D ....   

JTaylor

I remember testing an AI (probably?, depending on definition) in the early nineties that was tied into Informix and its 4GL language in some fashion.   It was pretty impressive.   I started asking it weirder and weirder questions and it finally responded with "This is getting silly." and ended the conversation.   I think Microsoft bought it and tried tying it into Access, and maybe Office, but the results were not very good from what I recall. 

Jim

td

Quote from: stanl on April 22, 2023, 10:44:01 AM
Had to ask GBT what an LLM is.... pretty sure your meaning is a far cry ;D ....

Sorry, I should have used the term instead of the initialization. I meant the loosely defined term "large language model".

https://en.wikipedia.org/wiki/Large_language_model

If I had used an AI-based writing tool, it would have pointed out the error of my ways.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade