ChatGPT and Livecode
Mike Kerner
MikeKerner at roadrunner.com
Thu Dec 8 10:38:28 EST 2022
fun
On Thu, Dec 8, 2022 at 5:09 AM Ludovic THEBAULT via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Hello all,
>
> Chatgpt knows Livecode and can propose code on a simple description, but
> it remains to be improved :-)
>
> Example : "Write a code for Livecode to read line by line a long text
> file. »
>
> ChatGPT :
> > on openCard
> > put "Enter the path to the text file:"
> > answer file
> > set the filePath to file
> >
> > put "Enter the maximum number of lines to read:"
> > answer maxLines
> >
> > put empty into lineList
> >
> > put 0 into lineCounter
> > put 0 into charCounter
> >
> > open file filePath for read
> > repeat for each line lineOfFile in file filePath
> > if lineCounter < maxLines then
> > add lineOfFile & cr after lineList
> > add 1 to lineCounter
> > else
> > add lineOfFile to charCounter
> > end if
> > end repeat
> > close file filePath
> >
> > put lineList
> > put charCounter & " characters remaining in file"
> > end openCard
>
>
>
> Ludovic
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
and did a little diving.
And God said, "This is good."
More information about the use-livecode
mailing list