AI generated Macro Code??

Hey everyone,

I am not a macro coder at all.

I saw some examples of AI generated Python code that people have been posting YouTube videos about. They are very worried that the AI has the ability to generate code based on simple text input explaining what they want to code to do.

So, I was curious if it could write a CorelDraw X4 macro

Here's the prompt I used

Write a coreldraw x4 macro that will alternate between uppercase and lowercase of the selected text

Here's the code that it created based on that prompt

Sub AlternatingCase
  Dim objText As TextRange
  Set objText = ActiveSelection.TextRange
  Dim i As Long
  For i = 1 To objText.Length
    If objText.Chars(i).Case = cdrCaseLower Then
      objText.Chars(i).Case = cdrCaseUpper
    Else
      objText.Chars(i).Case = cdrCaseLower
    End If
  Next
End Sub
I was curious to hear from the master coders here what you think of this AI generated code?
Parents
No Data
Reply
  • Jason, 

    Did you try the code? Let me spoil it for you, it doesn't work. :-)  And not for one reason but several. :-) 

    I am not worried about AI taking my job. That said, I am all for using AI as a tool. If that tool can help me write quality code faster then the better then that only makes me better. 

    Trey86, the popular AI right now is ChatGPT:  New chat (openai.com)

    -Shelby

Children
No Data