OT: Copilot makes a slight mistake

Started by spl, March 17, 2025, 11:24:23 AM

Previous topic - Next topic

spl

Having enjoyed the thread for fun with xml, reminded me of the old days in WB when a topic was broached by multiple participants all until the code was adequate. Maybe now, AI is the answer. So I asked copilot "Give me a Winbatch script to parse xml nodes"

AddExtender("WWInt51i.DLL", 0, 0) ; Load the XML extender

; Define the XML content or file path
xmlContent = `"<root>
                  <node1>Keep Me</node1>
                  <node2>Remove Me</node2>
                  <node3>Keep Me Too</node3>
               </root>"`

; Load the XML into the extender
xmlDoc = XMLLoadString(xmlContent)

; Find and remove the nodes you don't want
while XMLFindElement(xmlDoc, "node2")
    XMLRemoveElement(xmlDoc, "node2")
endwhile

; Save or output the modified XML
newXmlContent = XMLGetString(xmlDoc)
Message("Modified XML", newXmlContent)

; Clean up
XMLRelease(xmlDoc)

?????????????????
Stan - formerly stanl [ex-Pundit]

td

I guess you would need to perform some model training...
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

spl

Quote from: td on March 17, 2025, 01:34:56 PMI guess you would need to perform some model training...

Nah! Just need to find where the Extender is hiding [where is a good imogi when you need one]
Stan - formerly stanl [ex-Pundit]

td

Good luck with that. But there is always the alternative of you writing one for all of us.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

spl

Quote from: td on March 18, 2025, 09:03:42 AMGood luck with that. But there is always the alternative of you writing one for all of us.

Hey AI, can you write me a 32/64 bit Extender for manipulating XML in Winbatch?
Stan - formerly stanl [ex-Pundit]

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Quote from: spl on March 18, 2025, 11:01:39 AMHey AI, can you write me a 32/64 bit Extender for manipulating XML in Winbatch?


I already did ;-)

td

There you go. Problem solved and, at least I hope, no AI needed.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade