![]() |
|
[Shell] A semi-advanced parts shopping list - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] A semi-advanced parts shopping list (/showthread.php?tid=5832345) |
A semi-advanced parts shopping list - Sir-Teabag - May 2, 2018 Okay so yesterday in IT class we were building PC's. Instead of using excel (which i hate) I decided to use something in batch like Code set /p part= then I got extremely carried away and made this instead. It utilizes the 'type' command, to print the list in to another terminal which refreshes every two seconds or so. Commands: type 'listall' to list everything in the list without the price type 'cls' to clear the list ^note you have to type it as the item name, then press enter twice for either of those to work. You don't have to use it as a shopping list of course. I've got a few more project ideas that use the 'type' command in the same refreshing & %temp% methods used in this code. And since i'll probably never use this again after next week maybe someone here can. code - https://pastebin.com/VBx6RyRU (also note you can't use spaces for some reason)
RE: A semi-advanced parts shopping list - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - May 2, 2018 I actually think this is an excellent exercise. Perhaps you may find it useful to use Code for /f "tokens=*" %%a in (parts.txt) do echo %%aIf you wanted to pick out certain elements from your list, this would be the way to do it. I'm not sure if you're comfortable with enableDelayedExpansion (or for loops), but it would be incredibly useful to you as you could really spruce up this code! (Not that there is anything wrong with it) If you need any help, just ask. RE: A semi-advanced parts shopping list - Sir-Teabag - May 2, 2018 (May 2, 2018 07:02 PM)ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ Wrote: I actually think this is an excellent exercise. Haha yeah thanks bro. I actually did think the Code for tokensRE: A semi-advanced parts shopping list - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - May 2, 2018 (May 2, 2018 07:11 PM)Sir-Teabag Wrote: -snip- This is a 4 line bit of code that will help you understand Code @echo offRE: A semi-advanced parts shopping list - Sir-Teabag - May 3, 2018 (May 2, 2018 08:19 PM)ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ Wrote: This is a 4 line bit of code that will help you understand Hmm I think that makes sense.. Do you know any in-depth guides to this command? Cheers :D RE: A semi-advanced parts shopping list - Phlox - May 3, 2018 That's a very cool script @Sir-Teabag! RE: A semi-advanced parts shopping list - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - May 3, 2018 (May 3, 2018 01:07 AM)Sir-Teabag Wrote: Hmm I think that makes sense.. Actually I do lol https://hackforums.net/showthread.php?tid=3645708 RE: A semi-advanced parts shopping list - Sir-Teabag - May 3, 2018 (May 3, 2018 04:34 AM)ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ Wrote: Actually I do lol haha wow thank you very much! I'm sure this will come in handy soon |