Search found 64 matches

by shodan
13 May 2024 19:28
Forum: DOS Batch Forum
Topic: Dinosaur Game from Chrome in Batch - Remake
Replies: 1
Views: 157

Re: Dinosaur Game from Chrome in Batch - Remake

In pure batch too, I am impressed

I wonder if we will ever manage native batch Sixel support (without needing a terminal with builtin sixel support of windows 11)

https://askubuntu.com/questions/97542/h ... l-pictures

(see viu and icat)
by shodan
13 May 2024 19:20
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 12
Views: 746

Re: pushd popd depend on batch filenames with which they run... why?

Just for fun, I have asked chatgpt about this here is chatgpt classic https://chat.openai.com/share/1591e9b7-3a03-479e-8d32-83e6f5d2f968 here is chatgpt 4o, today's newest model https://chat.openai.com/share/ee8e7ba3-c929-4e65-8cbb-0f6bef333484 The best it got, is to use %CD% if you pushd a file wit...
by shodan
13 May 2024 18:54
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 52

Re: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Here are a few more of the support functions within I will revisit these when I present about the bfw batchfileframework officially :ShiftedArgumentCaller set _ShiftedArgumentCaller_function=%~1 shift set "_ShiftedArgumentCaller_function=" & GoTo :%_ShiftedArgumentCaller_function% GoTo :EOF :PrintWi...
by shodan
13 May 2024 18:49
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 52

Re: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Here are the functions themselves ::Usage Call :GetBasefunction BatchFile FunctionName ReturnVariable ::returns row number of BaseFunction :GetBaseFunctionRow :GetBaseFunctionName :GetBaseFunction set "_GetBaseFunction_prefix=_GBF" set "_GBF_BatchFile=%~1" set "_GBF_FunctionName=%~2" set "_GBF_Outpu...
by shodan
13 May 2024 18:37
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 52

Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Hi, functions.zip I made simple to use helper function, to determine if a function is a "base" function or an alias. Also to obtain a list of alias related to a specific base function. First, what is a function :Hello echo Hello,world GoTo :EOF Also, I have what I call the preamble and the post-scri...
by shodan
30 Apr 2024 03:22
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 2
Views: 221

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

Improved version of the functions This now works with strings at least 8100 characters long Mostly works with everything that doesn't contain poison characters New extensive test setup is very effective at finding any remaining bugs ! See function GetSubstringIndex-demo at the bottom and ready to us...
by shodan
30 Apr 2024 03:00
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 12
Views: 746

Re: pushd popd depend on batch filenames with which they run... why?

Tried adding filename to the tests The code AAA BBB.bat @ECHO OFF echo this is AAA BBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 4 %~dp0 echo this is AAA BBB.bat part2 echo 1 %~dpn0 PUSHD %~dp0 echo 2 %~dpn0 cd .. echo 3 %~dpn0 popd echo 4 %~dpn0 AAABBB.bat @ECHO OFF ech...
by shodan
30 Apr 2024 02:51
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 12
Views: 746

Re: pushd popd depend on batch filenames with which they run... why?

Hi, Just tried a simpler version Code for AAABBB.bat @ECHO OFF CLS echo this is AAABBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 3 %~dp0 Code for AAA BBB.bat @ECHO OFF CLS echo this is AAA BBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 3 %~dp0...
by shodan
29 Apr 2024 17:31
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 2
Views: 221

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

New version of Works to 8155 characters with byref input string, now supports byref parameters for either or both or none input and replace string Still breaks on poison characters Call :CreateRandomStringPS PUNCTUATION NOPOISON SPACE EXTENDED 8155 testvar ::Usage Call :ReplaceString InputString Rep...
by shodan
29 Apr 2024 17:26
Forum: DOS Batch Forum
Topic: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile
Replies: 8
Views: 2292

Re: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile

Thanks, My current solution is certainly derived from this comment. I found it in an old version of my functions but the use of echo( and the very similar structure, I'm sure that's where I got it from ! Looking at the differences He explicitely uses SETLOCAL DisableDelayedExpansion Which I don't be...
by shodan
29 Apr 2024 05:48
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 2
Views: 221

Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

See latest version at https://www.dostips.com/forum/viewtopic.php?p=69907#p69907 ------------------------------------ This was a lot of work ! If it wasn't so late, I think this directly leads to a fast and robust :split function as well ! This substring uses the similar mechanism as the :len functi...
by shodan
23 Apr 2024 15:03
Forum: DOS Batch Forum
Topic: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile
Replies: 8
Views: 2292

Re: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile

I have cracked it Posting before the forum times out again ! This will write the line number and line ranges from inputfile to output file ::Usage Call :AppendFileLineToFile inputfile outputfile 3 4 50-75 5 6 7 ... N :AppendFileLineToFile set "_AppendFileLineToFile_prefix=_AFLTF" set "_AFLTF_InputFi...
by shodan
22 Apr 2024 15:06
Forum: DOS Batch Forum
Topic: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile
Replies: 8
Views: 2292

Re: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile

Thank you that is some top tier wizardry In my current design, I planned to mostly rely on %~0 for function switching. I would achieve that with shortcuts / softlinks and/or hardlink I am creating a function, that lists all functions in a batch file, then creates/updates/deletes shortcuts/softlink/h...
by shodan
22 Apr 2024 04:54
Forum: DOS Batch Forum
Topic: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile
Replies: 8
Views: 2292

Re: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile

Looking in my older code, I found a function called "SimpleFileToArray" that takes lines of text from a file and loads them in an array of variable I just tested it and I think it might work for this. Here is the function itself. ::Usage Call :SimpleFileToArray OutputArray Filename :SimpleFileToArra...
by shodan
22 Apr 2024 03:54
Forum: DOS Batch Forum
Topic: Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile
Replies: 8
Views: 2292

Need help copying a line of text from a file to another (without mangling it) :AppendFileLineToFile

Hello I made this function to copy arbitrary lines of text, from one file to another ::Usage Call :AppendFileLineToFile inputfile outputfile 3 4 50-75 5 6 7 ... N :AppendFileLineToFile set "_AppendFileLineToFile_prefix=_AFLTF" set "_AFLTF_InputFile=%~1" set "_AFLTF_OutputFile=%~2" :AppendFileLineToF...