Saved Bookmarks
| 1. |
Solve : Parsing string from file twice? |
|
Answer» Quote from: Helpmeh on October 23, 2009, 03:01:45 PM I fiind it funny that the op has started to learn for loops before he or she has really learned the set command. A lot of people don't so much "learn" to write code, it's more a case of copying and pasting.Very true, but some people learn that way. I first learned how to use for loops by studying Jacob's code in his AoA Local BETA. If only I still have that .ZIP archive. I was one of those weirdo's who learned by reading the documentation... the MS-DOS 6 help, to be precise.Quote from: BC_Programmer on October 24, 2009, 07:44:16 PM I was one of those weirdo's who learned by reading the documentation... the MS-DOS 6 help, to be precise.I am one of those wierdos who are too young and weren't even BORN when MS-DOS was around. How much of that documentation would apply to the command processor in windows xp? and, Is it in digital format? and if the answer to the second question is yes, May I have a copy?ntcmds.chm is a lot better then the help reference included with MS-DOS. Quote from: BC_Programmer on October 24, 2009, 08:03:25 PM ntcmds.chm is a lot better then the help reference included with MS-DOS. %Windir%\Help\ntcmds.chm on XP but unfortunately, on many computers such as those made by Compaq/HP, they make it impossible to run ntcmds.chm separately from the help and support center, so you can't use the CHM search facility easily. I think running hh ntcmds.chm might do it though AS for Vista, not included, so get it from an XP system or install disk or from e.g. Windows Server 2003 Adminpak from Microsoft. Quote from: Helpmeh on October 24, 2009, 01:51:02 PM Very true, but some people learn that way. I first learned how to use for loops by studying Jacob's code in his AoA Local BETA. If only I still have that .zip archive. a LOT of people do the copy-and-paste part without doing the learning part though. Often they then say they have "written" a program, but are apparently quite oblivious of the most obvious errors and faults in the code thus produced. Errors that they would not have perpetrated had they actually thought about what the code does. Salmon Trout Thank you for your post. You are quite correct that %% vs. % is a little (lot?) foreign to me. I have been trying to find a good DOS book but they seem to be quite hard to get compared to 10 years ago. I will look at your code and give it a burl. PS: It is amazing how many posts can appear in these threads when you turn your back for a moment.Quote from: Helpmeh on October 24, 2009, 07:54:42 PM I am one of those wierdos who are too young and weren't even born when MS-DOS was around.Sigh. I had a birthday on the weekend and I am too close to 50 to want to think about it. I had a FIDDLE with DOS 1.22 when it first came out and continued until 5.0. After that I switched to C, Pascal for a few years. I had a 10 year break but now I am back programming. I have written some C code but to complere the task I was given DOS will help. DOS is easier for file moving, deleting etc: rather than C. Quote from: Helpmeh on October 24, 2009, 07:54:42 PM How much of that documentation would apply to the command processor in windows xp? and, Is it in digital format? and if the answer to the second question is yes, May I have a copy?A copy would be nice if possible.Quote from: Tigers! on October 26, 2009, 06:34:34 PM DOS is easier for file moving, deleting etc: rather than C.A copy would be nice if possible.if your task is just copying, moving deleting files, maybe. BUT if you want to go into serious programming, DOS is not the right tool. Computing has progressed SINCE your time. Nowadays, we don't just do moving, copying deleting of files.. there are a variety of tasks that people do such as grabbing stuffs from the internet and parsing HTML, XML, reading and parsing text inside PDFs, reading Word/Excel files and getting data, querying a database, telnetting, doing file transfers etc.... Quote from: Salmon Trout on October 23, 2009, 11:22:26 AM try this if you want to actually use named variablesST I modified the code to move my files and clean up and it worked a treat. Thank you for that. Further to your comments about learning more. Looking at your code I am puzzled by your use of %%a in two apparently different situations. Firstly you are using it (so it seems to me) to step through the tokens on the line and then you are using it as an actual variable with a known value. How does DOS keep track? You also assign the current value of %%a to the other variables %%b, %%c, %%d without explicitly assigning or setting them. Again how does DOS do that? Without a good reference book I find it hard to know abour comamnds like !!. I have not yet found a site that mentions seemingly obscure commands like that. Do you have a good, available book or site?!var! Is not a command. It is the same as %var% except WITHIN a for loop if delayedexpansion is enabled. I didn't learn any of my reasonable knowledge from a book. Trial, error and looking a others' codes. Quote from: Tigers! on October 27, 2009, 06:24:05 PM Looking at your code I am puzzled by your use of %%a in two apparently different situations. Firstly you are using it (so it seems to me) to step through the tokens on the line and then you are using it as an actual variable with a known value. How does DOS keep track? You need to read the FOR help. Open a command window and type FOR /? |
|