Search found 947 matches

by einstein1969
01 Nov 2022 09:00
Forum: DOS Batch Forum
Topic: error on for /f in the block
Replies: 3
Views: 2052

error on for /f in the block

Hello, I need help with a for /f if I run this code, the for /f gives me an error @echo off & setlocal enableDelayedExpansion >"%TMP%\env.txt" set set /a nl=10 ( for /f "skip=!nl! eol== delims==" %%V in (%TMP%\env.txt) do set "%%~V=" ) !nl! eol== delims==" non atteso. the for is inside a block, can ...
by einstein1969
27 Oct 2022 07:00
Forum: DOS Batch Forum
Topic: Why does SET performance degrade as environment size grows?
Replies: 33
Views: 60681

Re: Why does SET performance degrade as environment size grows?

after many years I need to understand why in dbenham's expansion tests there are no problems, while those of aacini show a degradation.
by einstein1969
24 Oct 2022 11:23
Forum: DOS Batch Forum
Topic: Complete control of cmd windows
Replies: 88
Views: 68497

Re: Complete control of cmd windows

Do you know if it is possible to handle mouse input in the dos window?
by einstein1969
24 Oct 2022 07:53
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

I have made further progress. I calculated the maximum expansion of the tabs and brought the tab_iter into the main loop. No more while..do / repeat..until loops I have minimized the Sets and the calls to the strlen. I have added comments doubled the size of the txt, now it's 646KB. Execution time d...
by einstein1969
24 Oct 2022 03:45
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

there was a wrong version in the zip I corrected and redid the tests. last version 10X short code Elapsed 83 sec. long code Elapsed 95 sec. einstein code Elapsed 44 sec. einstein code 2 Elapsed 15 sec. long code (einstein latest) Elapsed 11 sec. long code (einstein latest 2) Elapsed 9 sec. long code...
by einstein1969
24 Oct 2022 03:38
Forum: DOS Batch Forum
Topic: infinite loop with break condition
Replies: 75
Views: 119207

Re: infinite loop with break condition

aGerman wrote:
23 Oct 2022 11:43
It doesn't improve the performance in my tests.
Typical result:

Code: Select all

19:39:18,23
short code
19:39:22,16
long code
19:39:29,44
einstein code
19:39:31,02
einstein code 2
19:39:33,36
Drücken Sie eine beliebige Taste . . .
I understand why
you were using an old version
by einstein1969
24 Oct 2022 03:29
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

there is a very strange thing, you can check that you have more experience. if I transform the tab_iter into this: set i=0 For /L %%. in (1,1,1250) do ( if !i! lss !len! ( set /a "nxt=!i!+1" for %%I in (!i!) do ( if "!ln:~%%I,1!"=="%tab%" ( set /a "d=0-(%%I %% tabWidth)+tabWidth, e=nxt, nxt+=d-1, l...
by einstein1969
24 Oct 2022 03:24
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

last version. I have inline strlen. Last code 8sec on my laptop short code Elapsed 76 sec. long code Elapsed 96 sec. einstein code Elapsed 42 sec. einstein code 2 Elapsed 15 sec. long code (einstein latest) Elapsed 15 sec. long code (einstein latest 2) Elapsed 9 sec. long code (einstein latest 3) El...
by einstein1969
23 Oct 2022 13:51
Forum: DOS Batch Forum
Topic: infinite loop with break condition
Replies: 75
Views: 119207

Re: infinite loop with break condition

on my pc going down from 250 cycles to 100 cycles in the tab_iter procedure still increases performance by 10%
by einstein1969
23 Oct 2022 13:39
Forum: DOS Batch Forum
Topic: infinite loop with break condition
Replies: 75
Views: 119207

Re: infinite loop with break condition

you send me a zip of your tests so that there are no errors and I do the test on my pc and we compare the times
by einstein1969
23 Oct 2022 12:50
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

there is a very strange thing, you can check that you have more experience. if I transform the tab_iter into this: set i=0 For /L %%. in (1,1,1250) do ( if !i! lss !len! ( set /a "nxt=!i!+1" for %%I in (!i!) do ( if "!ln:~%%I,1!"=="%tab%" ( set /a "d=0-(%%I %% tabWidth)+tabWidth, e=nxt, nxt+=d-1, le...
by einstein1969
23 Oct 2022 12:27
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 42
Views: 39537

Re: Generating .pdf files with batch?

This version on my system passed from 43sec to 11sec (4X)

I have insert the subs inline and changed the strlen into macro faster version
by einstein1969
23 Oct 2022 12:07
Forum: DOS Batch Forum
Topic: infinite loop with break condition
Replies: 75
Views: 119207

Re: infinite loop with break condition

It doesn't improve the performance in my tests. Typical result: 19:39:18,23 short code 19:39:22,16 long code 19:39:29,44 einstein code 19:39:31,02 einstein code 2 19:39:33,36 Drücken Sie eine beliebige Taste . . . i have tested with about 400k of text.txt. I have replicated ten times the txt that y...
by einstein1969
23 Oct 2022 11:26
Forum: DOS Batch Forum
Topic: infinite loop with break condition
Replies: 75
Views: 119207

Re: infinite loop with break condition

I found that the multiple outputs within the loop including the "set /P" and file size readings were the cause of the slowdown (non-linear). I calculated the positions (making pads of the strings) and moved to a single output and removed the query of the file size and the performance doubled . Howev...