Saved Bookmarks
| 1. |
Solve : Inserting a Blank Space Before Set /P Output? |
|
Answer» Quote from: BC_Programmer on March 30, 2010, 07:18:06 AM Sure Python/Perl have modules you can use for nearly everything; so does VBScript. It's called COM. and COM components are a lot easier to use from VBScript as compared to either Python or Perlthat is not true. If one really have extensive experience with Python/Perl, you will know there are too many things vbscript cannot compare. Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH). Or find me a good compression LIBRARY that supports widely used compression algorithm in vbscript. Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible. How about a sorting function in vbscript? till now, i don't see very good support on sorting. And how about emailing mechanism or the ability to do network/socket programming easily? How about a library for HTML/XML parsing or a library to grab a web page that also supports proxy authentication or SSL? Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well. How about portability of code? Python/Perl scripts WORKS in Mac,*nix. Is vbscript portable? I use vbscript as well and i have no problem coding with it when the situation needs, but if i have a choice on language to use on a production project, it will not be vbscript Quote from: ghostdog74 on March 30, 2010, 08:12:54 AM Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH).http://www.chilkatsoft.com/FTP-ActiveX.asp Quote Or find me a good compression library that supports widely used compression algorithm in vbscript.Google gives me 126,000 hits for "ActiveX Compression Library" Quote Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible.All accessible via COM... or just create them yourself in VBScript classes. Seriously, you write them once, and you can reuse them. there doesn't HAVE to be a bloody module for every single god damned thing you mgiht want to use. Quote How about a sorting function in vbscript? till now, i don't see very good support on sorting.Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts. Quote And how about emailing mechanism or the ability to do network/socket programming easily?CDO. WinSock Control/Library. Quote How about a library for HTML/XML parsingMSXML. Quote or a library to grab a web page that also supports proxy authentication or SSL?WinHTTP. Quote Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well. Did you even read my post? Quote from: BC_Programming and COM components are a lot easier to use from VBScript as compared to either Python or Perl (which in themselves need a module for this purpose) Quote How about portability of code? Python/Perl scripts works in Mac,*nix. Is vbscript portable?Nope. Sometimes I forget how important that 0.5 percent (ok, that's an underrepresentation) of the market considers itself though. Quote from: BC_Programmer on March 30, 2010, 08:40:39 AM http://www.chilkatsoft.com/FTP-ActiveX.aspI was betting you are going to show me this. sad to say first version out of support and limited in functionality. 2nd version cost money. seriously ? Quote Google gives me 126,000 hits for "ActiveX Compression Library"out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community. Quote Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts.sorting stuff is so common in daily task, you don't rewrite it when you want to use it every time . A good sorting library is a certainly a plus point. Try writing one by hand, that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically. how much time would you need to do it with vbscript? A module for every thing i want to do is even BETTER. honestly speaking, don't you sometimes want that? Quote sorting stuff is so common in daily task, you don't rewrite it when you want to use it every time No. you write it ONCE. and then you can that every time. Quote A good sorting library is a certainly a plus point. Try writing one by hand, that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically. Ever worked with listviews? Ever needed to do that as well as Natural sort the filename column? Yeah. done that. Actually, I didn't write the code that does the sort algorithm, that is actually in comctl32. My Actual Sorting stuff can be used to sort objects, and since the Actual comparison routine can easily be overridden it's a simple matter to change the comparison to make it sort on different fields. This wouldn't extend directly to VBScript since none of the scripting languages supports early-binding to COM components that I know of nor implementing a COM interface. I think they support event sinking so I could just make it raise events or something. Either way, I never have to do anything with VBScript. I only have one Script file that I ever use, that re-links an executable to change the subsystem. That's it. I largely consider VBScript to be VB6 but to be frank VBScript blows in comparison. and I am reminded of that every time I use VBScript. WHY does it complain when I say Next ? I could swear that's part of the language, but noooo, it makes me say just "next"... Quote I was betting you are going to show me this. That was just from a quick google. There are FTP controls built into windows but I'm not sure if those can be used without a IOLEInPlaceSite implementor. (that is... a window) I know the "Script control" can be used just as an Object. Quote out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community. Personally I'd just Use BCFile for that. Of course I'd need to get BCFile to work in VBScript, a mystery I have yet to bother solving since I never use VBScript, or any other scripting language often enough. Actually, I think I've lost track of the very point of a scripting language, which is, in general, to provide these types of things. unzipping and zipping can be done with the built in windows Zipping/unzipping but the mechanism for doing so isn't immediately obvious. It can be used indirectly by simply copying a file out of a zipped file namespace, but again- not completely obvious. Anyway, I think this is what confused me: Quote but if i have a choice on language to use on a production project, it will not be vbscript a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other TOP contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more. Language wars, I love them !! Seriously, if I wanted to ftp from vbscript I would (and have) call the ftp.exe on the command line Going back to the OP's question, are there 'invisible' characters that can be used as a space ? I remember the old DOS trick of naming a file -255 to hide it no longer works under 32 bit windows Just a THOUGHT - does echo Hallo give the required indentation ? If so and you can live with a non-indented response, follow the prompt with: Set /p var= Which will not add any prompt textseems like W7 set /p strips leading spaces from the prompt string. Quote from: Salmon Trout on March 30, 2010, 02:17:21 PM seems like W7 set /p strips leading spaces from the prompt string.Yes, and so does Vista. The command interpreter is "CMD.EXE" and it seems to be not the same one used in Windows XP that has the same name. So the challenge here is to either: 1. Modify the way CMD does the SET command to allow e space char. OR 2. A clean utility that will show a custom prompt to user and take input and store in something that can be used later. Hmmm, "assembly language for windows" gives almost 2 million hits in Google. Maybe I should write a small machine code thing. Quote from: BC_Programmer on March 30, 2010, 09:46:49 AM No. you write it ONCE. and then you can <re-use> that every time.that's right.! write it once and reuse. that's the beauty of modules/functions. I don't see a vbscript sorting function/library that is able to provide different sorting criteria, like the one i mention, or sorting by keys of a dictionary, or sorting an array according to the keys of another. or sorting by the Nth character position. If i want to do any of these sorting tasks, i just need to plug in my parameters and the sorting function will do the rest. Quote a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other top contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more.that's not correct. PHP is a scripting language and there so many production web sites that use PHP. Similarly for Perl/Python. Why do you think sysadmins use them to do their admin task? Scripting languages can definitely by used anywhere. And Perl/Python are also considered scripting languages (general purpose). no different from vbscript. they both need interpreter to run their script. Quote from: gpl on March 30, 2010, 12:42:43 PM Just a thought - does If I understand what you are saying correctly, the problem here is that set /p always(I think) uses its own line, even if you do something like: Code: [Select]echo Faking the promptString here & set /p var=The user's input would start on a new line after the fake promptString, which is messy, and is still yet a displayed line that is not getting indented. I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool. I think I need to read the C book I bought 2 years ago and just be done with it. ...then again maybe not Thanks to everyone again for all the help, this is a great community to be a part of, I wish I had more to give back. Quote I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool. You have made a wise choice. Not the choice of everybody, Not the choice of the most clever. But the choice that will work for you. Quote from: Geek-9pm on March 31, 2010, 01:13:30 PM Not the choice of the most clever. Are you saying I'm not clever? Quote from: Salmon Trout on March 31, 2010, 01:16:50 PM Are you saying I'm not clever?Ah...er.. uh maybe I shod rephrase that. Quote from: Geek-9pm on March 31, 2010, 01:28:51 PM Ah...er.. uh maybe I shod rephrase that. ah ha! so your saying his idea is shoddy! Quote from: BC_Programmer on March 31, 2010, 01:30:10 PM ah ha! so your saying his idea is shoddy! I have been to "The shoddy capital of West Yorkshire", the town of Dewsbury. In the 19th century that region of England had a thriving cotton spinning industry and somebody invented a machine for grinding rags or pieces of waste or used cotton cloth, which was called "shoddy", so that the fibres ("fibers" in the US) could be spun into new cloth. The town became the hub of this industry and even in the 1980s the place was full of cotton recycling plants and in the streets you could see little bits of fluffy stuff lying on the ground. It made some people rich and gave jobs to a lot more. |
|