Is there a max character limit for loopread?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Is there a max character limit for loopread?

Post by hieveryone » 10 Jun 2023, 09:18

My script just loops and stops after a certain amount of characters I'm pretty sure that's the problem
Last edited by gregster on 10 Jun 2023, 09:29, edited 1 time in total.
Reason: Moved from 'About this Community' to 'Ask for Help (v2)', assuming that this is a AHK v2 question.

User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Is there a max character limit for loopread?

Post by boiler » 10 Jun 2023, 10:51

What do you mean it stops? It doesn’t loop any more or it just doesn’t read all the characters in a line? Do you mean total amount of characters read? That would likely have to do with whether you are storing them all and filling up available RAM. You need to provide some detail about what stops working and what specifically led you to that conclusion. Note that the documentation says:
Loop Read ‘Remarks’ section wrote:Lines up to 65,534 characters long can be read. If the length of a line exceeds this, its remaining characters will be read during the next loop iteration.

Do you realize that it stops after reaching the current end of the file? Based on a prior thread of yours, it seems you may be using this to try to continue to read a chat log file as more is added to it. It will not do that and you are using the wrong approach if that is your goal. This is an approach to monitoring log files. It can be adapted to v2.

hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Is there a max character limit for loopread?

Post by hieveryone » 11 Jun 2023, 00:51

@boiler
So There is a txt that it reads and each time its ment to send it as a variable, but it just stops after a certain line. All the lines are only up to 100 characters each the txt in total has unde 4000 characters. but it just stops at like 3000 is there a reason why it does that?

hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Is there a max character limit for loopread?

Post by hieveryone » 11 Jun 2023, 01:52

@boiler
wait I found out that there is no character limit. But whatever line it is it always stops on the word sunscreen im really confused, is there a code the breaks the loop on the word sunscr?

User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Is there a max character limit for loopread?

Post by boiler » 11 Jun 2023, 05:12

You should post your code.

hieveryone
Posts: 43
Joined: 28 Nov 2022, 01:31

Re: Is there a max character limit for loopread?

Post by hieveryone » 11 Jun 2023, 22:40

Basically its a simple code that is just,
send enter
send whatever line in the file
send enter again
wait repeat. Thats it.
But I have tried two files, and they at different lengths but they both always stop on "sunscr"

I didnt write anything for it to stop on "sunscr"

I will be doing some more tests to see if I replace the word with a different word if it still works otherwise I dont really know. But I guess its not that important anyway
I will also do some tests weather if I make it shorter, will it work
@boiler

User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Is there a max character limit for loopread?

Post by boiler » 11 Jun 2023, 23:40

Something is wrong with the script or the file, and we can’t help if you don’t post anything and just keep repeating that. You seem to be thinking that someone is going to answer “yes, it’s a known issue that AHK stops reading files if the word sunscreen appears” or something like that.

Post Reply

Return to “Ask for Help (v2)”