Search found 969 matches

by einstein1969
17 Jul 2025 02:07
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

even shorter. setlocal set "args=%1 %2" for /f "tokens=1-3" %%1 in ("!args! FEDCBA9876543210") do ( if defined %%~1 ( if "" neq "!%%~1:~255!" ( if "" neq "!%%~1:~4095!" ( set "$=!%%~1:~4095!" ) else set "$=!%%~1!" set "$scale=!$:~255,1!!$:~511,1!!$:~767,1!!$:~1023,1!!$:~1279,1!!$:~1535,1!!$:~1791,1!...
by einstein1969
17 Jul 2025 01:34
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

I was referring to the slowing down of the "set": Why does SET performance degrade as environment size grows? This is a version that reduces the macro size while still maintaining almost all of its speed. It's a good fit for me. setlocal set "args=%1 %2" for /f "tokens=1,2" %%1 in ("!args!") do ( if...
by einstein1969
16 Jul 2025 15:37
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

I tried to optimize the upper part even more, this is the code and the times setlocal set "args=str len" for /f "tokens=1,2" %%1 in ("!args!") do ( if defined %%~1 ( if "" neq "!%%~1:~255!" ( if "" neq "!%%~1:~4095!" ( set "$=!%%~1:~4095!" ) else set "$=!%%~1!" set "$scale=!$:~255,1!!$:~511,1!!$:~76...
by einstein1969
16 Jul 2025 13:08
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

I made another version that's even faster, but I discarded it because the macro was too long and the env for Win 10 is a problem.

I haven't tried it on Windows 11, but they told me the set problem related to the env size is no longer there.

Do you know if this is the case?
by einstein1969
16 Jul 2025 13:02
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

I took the last one you made and optimized it a bit. I removed a "Set" from everything and removed another set for some lengths. Also in the upper part from 4096 to 8192. I compared it, and it's faster than the last one. Of course, I compared the code without the macros. I think you'll have to figur...
by einstein1969
15 Jul 2025 11:45
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 43
Views: 137032

Re: strLen boosted

It's been a year since the version I had on my PC. Yours seems faster. I haven't had time to study it. I added it to the old tests and I think the added checks and setlocal slow it down a bit. Now I'm studying it to see if there's anything I can improve on in terms of speed. @echo off setlocal Enabl...
by einstein1969
03 May 2025 08:40
Forum: DOS Batch Forum
Topic: 3D rotating donut
Replies: 5
Views: 10433

Re: 3D rotating donut

... "_SIN=a-a*a/1920*a/312500+a*a/1920*a/15625*a/15625*a/2560000-a*a/1875*a/15360*a/15625*a/15625*a/16000*a/44800000" this seemed to have an algorithm protection ex) 1+3 =4 or (1/2 + 3/40*20)*200/100=4 there is no protection, if you calculate the third term for x=7000, with your formula it gives 13...
by einstein1969
28 Feb 2025 03:31
Forum: DOS Batch Forum
Topic: Dos Batch Math Library
Replies: 73
Views: 259388

Re: Dos Batch Math Library

@miskox I'm trying that formula 10000*y/10/2 and mathematically since there is a multiplication by 10000 (which has 2 and 5 among the prime factors) the division by these should give an exact integer result without remainder or fractional part. That is, for any Y in that formula there is no remainde...
by einstein1969
25 Nov 2024 10:58
Forum: DOS Batch Forum
Topic: SET /A overflow
Replies: 7
Views: 18823

Re: SET /A overflow

... In addition worked around the bug: "if 2147483647 LSS -1 echo true" echoes "true" on windows xp home 32 bit (?!) but it's not a bug only for "-1" it does it for all the pairs that have the same representation and with the bit sign different. At least it seems to me. On win10 if 2123153877 lss -...
by einstein1969
11 Oct 2024 05:11
Forum: DOS Batch Forum
Topic: help with multilinea macro in not delayed
Replies: 4
Views: 43152

Re: help with multilinea macro in not delayed

basically the question is this. Is it possible to bypass the endlocal barrier/tunnel inside a call of variables that have LF or in any case the code to create multiline macros? I enter the procedure with the value of the delayed variables or active or inactive, then I activate it if necessary, I do ...
by einstein1969
22 Sep 2024 14:52
Forum: DOS Batch Forum
Topic: help with multilinea macro in not delayed
Replies: 4
Views: 43152

Re: help with multilinea macro in not delayed

I explained myself badly. I expanded the code hoping that you can understand where I'm having difficulty I have a code that reads a file and prepares the macro in this format: set macro=<code>[LF]<code>[LF]<etc> @echo off setlocal enabledelayedexpansion rem From Honguito98 idea call :AutomacroLite "...
by einstein1969
22 Sep 2024 06:06
Forum: DOS Batch Forum
Topic: help with multilinea macro in not delayed
Replies: 4
Views: 43152

help with multilinea macro in not delayed

unfortunately with macros and the various /escape/ etc substitutions I have never been able to. I am making a "Lite" version of the "automacro" program that Terry T3rror made https://www.dostips.com/forum/viewtopic.php?f=3&t=11339 . This is because I need to keep the macros also in the form of subpr...
by einstein1969
31 Jul 2024 12:32
Forum: DOS Batch Forum
Topic: Reduced-Flicker in dos batch. It's possible?
Replies: 40
Views: 167306

Re: Reduced-Flicker in dos batch. It's possible?

2icarius and 2einstein: I don't want to argue. I just thought that it was obvious to use ESC sequences for Win10+ without writting this (maybe somebody has Win10 only so this would look better). Or to have two different codes or one code with a check if OS WIN10+ or not. Saso yes yes it's better to...
by einstein1969
30 Jul 2024 17:25
Forum: DOS Batch Forum
Topic: Reduced-Flicker in dos batch. It's possible?
Replies: 40
Views: 167306

Re: Reduced-Flicker in dos batch. It's possible?

I also wanted to tell Antonio that when he said that cmd couldn't postpone writing and did it right away, he was right. But it's exactly because of that way that the flickering could be created. Instead, if we ask it to write when everything is updated and maybe the "time" variable is also updated. ...
by einstein1969
30 Jul 2024 17:11
Forum: DOS Batch Forum
Topic: Reduced-Flicker in dos batch. It's possible?
Replies: 40
Views: 167306

Re: Reduced-Flicker in dos batch. It's possible?

be good don't argue. The issue has been in limbo for a long time. Actually that code was written when windows 10 didn't have escape sequences yet. So that code was developed when escape sequences didn't exist so it didn't include the use of windows 10 sequences. At the time other mechanisms were use...