Search found 2293 matches

by dbenham
17 Apr 2011 23:07
Forum: DOS Batch Forum
Topic: Access complex parameters
Replies: 15
Views: 6505

Re: Access complex parameters

Using aGerman's myBatch: caller: @echo off cls setlocal enableDelayedExpansion set var1=hello^ you echo ---- Test1 ---- echo We have seen this already. call myBatch !var1! echo: echo ---- Test2 ---- echo This is new to me call (this is totally ignored!?)&echo What is going on? echo: echo ---- Te...
by dbenham
14 Apr 2011 01:24
Forum: DOS Batch Forum
Topic: EZ-DOS DOS Web Server?
Replies: 2
Views: 1774

Re: EZ-DOS DOS Web Server?

I was able to download version 1.1.3.0 here http://wiki.oldos.org/Downloads/MSDOS. I did not run the exe.

Like you I didn't find functioning link for 2.0.
by dbenham
13 Apr 2011 22:29
Forum: DOS Batch Forum
Topic: Access complex parameters
Replies: 15
Views: 6505

Re: Access complex parameters

Interesting... I tried the following: caller.bat @echo off setlocal enabledelayedexpansion set var=hello^ you set var call myBatch "!var!" results: >caller var=hello you 1:"hello 2:"hello > The error is gone, but what happened to "you"? I don't suppose your secure param...
by dbenham
13 Apr 2011 22:03
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

I think this project is now complete! (with the exception of bugs which are bound to crop up ). The library now supports 255 ASCII characters (only 00 NUL not supported). I've fully incorporated Jeb's new found technique allowing a function to return any string value, regardless whether the function...
by dbenham
10 Apr 2011 20:58
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

Oh my goodness Jeb! Your solution is insanely clever. I'm able to follow the substitutions, but I'll have to spend more time looking at your explanation to fully understand the games you play with ! Thankfully I don't have to fully understand it to use it. I've finished incorporating your improved m...
by dbenham
08 Apr 2011 06:56
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

I have fixed two bugs in my last posted code- :chr and :hex2str both failed with ; (0x59) due to the default FOR /F "eol=;" option. Unfortunately eol= option cannot be completely disabled like "delims=", there is always an eol character. (The description of eol within "help ...
by dbenham
07 Apr 2011 16:26
Forum: DOS Batch Forum
Topic: groupby and spliting
Replies: 5
Views: 2667

Re: groupby and spliting

Assuming: input data is in input.txt in current directory output goes to output.txt in current directory an err code of 0=succcess, any other value=error output: grouped by series date = earliest date series appeared ecount = error count = sum of count with err<>0 scount = success count = sum of cou...
by dbenham
07 Apr 2011 15:04
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

The character searching in :asc or in :str2hex could be enhanced by a map (similar to :strLen) set "ch=a" set "ascMap=000#101#202#A41#B42" set "split=!ascMap:*%ch%=!" set /a "hexVal=0x!split:~0,2!" Great idea Jeb. I had hoped to use one map that would convert...
by dbenham
06 Apr 2011 23:53
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

Correction - the code block is converting the TAB into 3 spaces. The TAB in the map outside the code block is correct. But the 161st character after the = is supposed to be ASCII decimal 160, but it has been corrupted into a space in both places.

Dave
by dbenham
06 Apr 2011 23:38
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

Well I finally did what should have been obvious, and downloaded a free Hex editor. (thanks Jeb) It's much easier to investigate and work things out now. I added two additional related functions: :hex2str converts a string of hex digits into a string (for example 414243 -> ABC) :str2hex converts a s...
by dbenham
01 Apr 2011 17:36
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

Thanks Jeb

I'll try out your suggestions in a few days. I'm heading out of town in a few minutes and won't have access to a computer.

Dave
by dbenham
01 Apr 2011 17:30
Forum: DOS Batch Forum
Topic: :lTrim bug and improved function template
Replies: 2
Views: 2237

Re: :lTrim bug and improved function template

Thanks Jeb for pointing out the flaw. I humbly withdraw my suggestion for the modified function template. I don't see a practical way to create a function that supports calls while delayed expansion is enabled. I think the :lTrim function should still be fixed though (switch from enabled to disabled...
by dbenham
01 Apr 2011 14:43
Forum: DOS Batch Forum
Topic: RENAME using redirection operators......
Replies: 2
Views: 2420

Re: RENAME using redirection operators......

Because command (program) command line arguments are not the same thing as command (program) input (also known as stdin, or standard input). From an English language perspective, yes they are both forms of input to the program. But from a programming standpoint they are very different. The < operato...
by dbenham
01 Apr 2011 13:10
Forum: DOS Batch Forum
Topic: new functions: :chr, :asc, :asciiMap
Replies: 31
Views: 39304

Re: new functions: :chr, :asc, :asciiMap

Simple solution, and powerfull. Thanks Jeb! What about the other issues in my prior back-to-back posts? I still can't get the other chars in my source code (editor limitation). But even if I do I'm worried what will happen when the command line interprets the text at execution time. For example, wil...
by dbenham
01 Apr 2011 12:44
Forum: DOS Batch Forum
Topic: :lTrim bug and improved function template
Replies: 2
Views: 2237

:lTrim bug and improved function template

There is a bug in the current :lTrim function that prevents it from supporting strings containing ! test0.bat - Test with existing code: @echo off setlocal disableDelayedExpansion set kind=cruel set test= Hello !kind! world! Goodbye! and Hello again! and so on... set test call :lTrim test set test e...