Search found 166 matches

by Jer
11 Sep 2020 18:43
Forum: DOS Batch Forum
Topic: Case sensitive comparison-why doesn't this work?
Replies: 2
Views: 213

Re: Case sensitive comparison-why doesn't this work?

String substitution is not case sensitive. Squashman, thank you for that lesson.
by Jer
10 Sep 2020 22:06
Forum: DOS Batch Forum
Topic: Case sensitive comparison-why doesn't this work?
Replies: 2
Views: 213

Case sensitive comparison-why doesn't this work?

I can't see why the code below does not give the results I expect, give one match in a case sensitive comparison. The code represents an issue in a larger script. I'm probably confused and need expert help :roll: Yes, I read /? IF Jerry @echo Off setlocal EnableDelayedExpansion set "string=a" call :...
by Jer
01 Jul 2020 11:11
Forum: DOS Batch Forum
Topic: Best command to delete a file?
Replies: 3
Views: 984

Re: Best command to delete a file?

Thanks for both for the explanations and examples of redirection of the error message. The shorter and safe method, del "%tempFileID%" 2> NUL is the one I'll use. Batch tools in my never-ending project write temporary files to get to the end product, and file removal is done after each temporary fil...
by Jer
29 Jun 2020 22:13
Forum: DOS Batch Forum
Topic: Best command to delete a file?
Replies: 3
Views: 984

Best command to delete a file?

I see this in a post: del file.tmp 2>nul

I delete temporary files using this syntax: IF EXIST "%tempfileID%" DEL "%tempfileID%"
Is there a preferred way to do this?
Thanks.
Jerry
by Jer
20 Jun 2020 11:44
Forum: DOS Batch Forum
Topic: Paint & Animation Studio
Replies: 9
Views: 1779

Re: VT code Batch Paint

Supporting files were required. That was the solution. Thanks. :)
by Jer
20 Jun 2020 10:38
Forum: DOS Batch Forum
Topic: Paint & Animation Studio
Replies: 9
Views: 1779

Re: VT code Batch Paint

My O/S is Windows 10 64bit. Any idea about these errors, displayed with echo on? Font is set to Consolas 16. C:\Temp\DOSBatch>Set /A Max.Width= ( CurrentHorizontalResolution / ( Font.W * SF ) ) Divide by zero error. C:\Temp\DOSBatch>Set /A Max.hieght= ( ( CurrentVerticalResolution / Font.H ) / SF ) ...
by Jer
14 May 2020 23:22
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3159

Re: Debugging / syntax checksing tools for batch

I am a batch hobbyist working on large scripts, and these tips help me in debugging. - First, did you close the console window and rerun? If it worked without error, you could have had interfering variables in the environment. I am assuming you do not want your batch script to leave variables assign...
by Jer
18 Jan 2020 16:53
Forum: DOS Batch Forum
Topic: If/Else in 1 line--only do something from Else statement
Replies: 6
Views: 2491

Re: If/Else in 1 line--only do something from Else statement

My O/S: Microsoft Windows [Version 10.0.18362.592] Obviously your Windows version is superior to mine :wink: @echo off setlocal set "code=100" If %code% gtr 0 If %code% leq 255 () else set "code=" If defined code (echo %code% is within limits) else echo value is NOT within limits C:\Temp\DOSBatch>te...
by Jer
18 Jan 2020 11:25
Forum: DOS Batch Forum
Topic: If/Else in 1 line--only do something from Else statement
Replies: 6
Views: 2491

Re: If/Else in 1 line--only do something from Else statement

penpen, I will use your "( rem: )" solution to do nothing when a numeric value passes the lower and upper limits test. Speed in not an issue because only a few values are checked from a command-line entry. Thanks for your solution: If %code% gtr 0 If %code% leq 255 ( rem: ) else set "code=" Entries ...
by Jer
17 Jan 2020 19:20
Forum: DOS Batch Forum
Topic: If/Else in 1 line--only do something from Else statement
Replies: 6
Views: 2491

Re: If/Else in 1 line--only do something from Else statement

DQ2000, what happened when you tested your solution? I get the error message: ) was unexpected at this time. Something like this works: If %code% gtr 0 If %code% leq 255 (set .=) else set "code=" but I'm asking to see if if there's a right way to do this, as I am prone to do it the wrong way first.
by Jer
17 Jan 2020 16:53
Forum: DOS Batch Forum
Topic: If/Else in 1 line--only do something from Else statement
Replies: 6
Views: 2491

If/Else in 1 line--only do something from Else statement

What is the best coding form in writing this If/Else statement on 1 line? I have "echo OK" where nothing should be done. What should I replace it with? "(rem)" acted as if the batch file did nothing. Sorry if this topic was covered somewhere in history and I forgot the solution :? Thanks. Jerry @ech...
by Jer
25 Nov 2019 16:14
Forum: DOS Batch Forum
Topic: Can I get access to an ascii character not in the standard set?
Replies: 38
Views: 13855

Re: Can I get access to an ascii character not in the standard set?

As posted in this forum, TinyPic image hosting is no longer available and this caused my images to go away. These links, after right clicking and choosing open in a new tab, pull up my project sample images for me. Clicking on the link just shows a white screen on my Windows 10 PC w/Firefox browser....
by Jer
09 Aug 2019 10:58
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 7481

Re: SORT Order not working correction

Here's my solution which is to create an artificial sort field. I'm looking forward to reading Antonio's solution. I rearranged lines in the source text to show that it works. @echo off setlocal EnableDelayedExpansion set "srce=source.txt" set "del=|" >_temp.txt ( For /F "tokens=1-6* delims=%del%" %...
by Jer
05 Jun 2019 20:17
Forum: DOS Batch Forum
Topic: For Loop - How do I keep the delimiter?
Replies: 0
Views: 16263

For Loop - How do I keep the delimiter?

Keeping the delimiter when parsing a string with a For loop was covered previously; I can't find it and I forgot how it was done. It was some trick with the asterisk. From a user entry, remove "+10" from string "509 1116+10 88" leaving "509 1116 88" The "+" option is valid when browsing the whole da...
by Jer
08 May 2019 12:19
Forum: DOS Batch Forum
Topic: Fire-Colored particle system
Replies: 6
Views: 2760

Re: Fire-Colored particle system

I have questions about two lines. If someone could explain, that would be great. What does "& echo !esc![?25l" do? In the assignment of screen, how is "H" doing its job? Changing it to some other character gives different spacing and frequency. "G" and "I" produce many more characters than H. Thanks...