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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to