Post by rogercabo on Mar 1, 2023 21:04:29 GMT 1
UPDATE:
I decided to change GFABASIC32A to GB32 simply. Unfortunate ChatGPT decided to use the older version of GFA-BASIC-32 that result in mixing up all the things. When using GB32 as a new Code language, he didn't try to use the older version.
Here is an example how to learn ChatGPT the GFA-BASIC 32 syntax. Now we tell ChatGPT to learn "GB32" he didn't know at all.
Copy & paste into the chat field:
I decided to change GFABASIC32A to GB32 simply. Unfortunate ChatGPT decided to use the older version of GFA-BASIC-32 that result in mixing up all the things. When using GB32 as a new Code language, he didn't try to use the older version.
-
Here is an example how to learn ChatGPT the GFA-BASIC 32 syntax. Now we tell ChatGPT to learn "GB32" he didn't know at all.
Copy & paste into the chat field:
Learn the programming language GB32 syntax for Windows, do not write comments for the commands you are learning now. Wait until my next text message to start learning.
Here is some code you can learn and if you have questions, plz ask:
[
Declare any variable with Dim
Dim VarName% = 0 // prefix % 32 bit integer
Dim VarName# = 0 // prefix # Double
Dim VarName // Variant
Dim VarName$ // String
Global VarName // Declares a variable or array that can be accessed in all subroutines.
Static VarName // Declares a variable or array that is only available in subroutines. When the subroutine is exited, the content of the variable/array is preserved until the next call.
Dim VarName // Dim declared in a subroutine declares a variable that is only available in that subroutine.
Declare any Array variable with Dim example: Dim VariableName(0) // this will create an array with one element. And can be accessed with VariableName(0).
Var Types of Arrays can be: % 32 bit integer, # Double, Variant
For i% = 0 to [VarName/literal] Step : [VarName/literal] : Next i% // For loop
Exit For // Exits the current for loop to the next beginning of the outer loop if there is one.
Do : Loop // Do Loop loop
Do : Loop Until [Condition]
While [Condition] : Wend // While Wend loop
Repeat : Until [Condition] // Repeat Until loop
If [Condition]
Else [Condition] Optional
EndIf
Function FunctionName([ByRef/ByVal] Parameter variable passed as [VariableType or Array or Type], [...]) As VariableType // With return value
Return VariableType // Always use Return when returning a value. 'Return' immediately exits the function at this point.
EndFunction
Procedure SubroutineName([ByRef/ByVal] Parameter variable passed as [VariableType or Array or Type], [...]) // without return value
[CODE]
EndProcedure
]
ChatGPT has now learned the first syntax of GB32 and comment all leaned correctly. Be amazed!
Now if you want to update some syntax write: And write the new syntax directly blow the following sentence. Otherwise it may go wrong.
Now it's time for an example: Tell ChatGPT to write a function in GB32 to calculate the 'easter-date' for a year. Where the year is given as a parameter year% by reference.
And he didn't use DateSerial().

In a previous example he use DateSerial() because of mixing stuff up of the old version.

An additional test to check if ChatGPT has really learned GB32
Create a new chat field:
Enter: Write a code in GFA-BASIC 32
Here you see the result is completely 16bit for DOS.
Compare the syntax:

Have fun!

Now if you want to update some syntax write: And write the new syntax directly blow the following sentence. Otherwise it may go wrong.
Learn additional syntax for GB32 for Windows:
[Then write your stuff you want to learn ChatGPT containing in braces]
Now it's time for an example: Tell ChatGPT to write a function in GB32 to calculate the 'easter-date' for a year. Where the year is given as a parameter year% by reference.
And he didn't use DateSerial().

In a previous example he use DateSerial() because of mixing stuff up of the old version.

An additional test to check if ChatGPT has really learned GB32

Create a new chat field:
Enter: Write a code in GFA-BASIC 32
Here you see the result is completely 16bit for DOS.
Compare the syntax:

Have fun!