Saved Bookmarks
| 1. |
Solve : Bat programming question...? |
|
Answer» Quote from: Carbon Dudeoxide on January 10, 2009, 09:48:46 PM Quote from: BC_Programmer on January 10, 2009, 09:38:40 PMoops! that's weird, my post was messed up... it said "removed for reasons above" instead of the code I had... DOH! Lol, I thought there was something STRANGE. I could have sworn it looked right in preview. You should have put it in red I just thought I pressed paste or something (strangely, YES, that was on my clipboard...) I say it sounds like a version tracking batch, similar in function to windows "shadow copies" or whatever they are called now. Of course, with all the hypotheticals and test cases, it's hard to REALLY know.Quote from: BC_Programmer on January 10, 2009, 09:03:00 PM Sorry carbon, gotta "Contrex" this one, if you know what I mean! Not even close! Supervisor, there are two ways of incrementing a numerical variable: (1) set /a variable=%variable%+N (where N is either a literal number e.g. 1, or a %variable%) (2) set /a variable+=N (ditto) The advantage of method (2) is that it works inside parenthetical expressions such as loops and block IF structures without the need to ENABLE DELAYED expansion and use the !variable! notation. Code: [Select]C:\>set /a var=1 1 C:\>set /a inc=5 5 C:\>set /a var=%var%+1 2 C:\>set /a var=%var%+%inc% 7 C:\>set /a var+=1 8 C:\>set /a var+=%inc% 13 You will find that 5 minutes of experimenting will tell you much more than a week of posting questions and waiting for answers. Quote from: Ivy Mostly people have no Idea how annoying contrex can get, he can disturb a persons mental state for ever(personal experience) Come on here with attitude, you get what you deserve. Quote Not even close! I must continue my training at the ZBoard.... |
|