Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: command line syntax  (Read 10743 times)

0 Members and 1 Guest are viewing this topic.

Dias de verano

  • Guest
Re: command line syntax
« Reply #15 on: June 27, 2008, 12:51:27 PM »
The thread is not extra wide for me either in Firefox 3 or IE6.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: command line syntax
« Reply #16 on: June 27, 2008, 12:55:08 PM »
I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing. :)

Like I said,

Quote
Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.

Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol
I was trying to dereference Null Pointers before it was cool.

Dias de verano

  • Guest
Re: command line syntax
« Reply #17 on: June 27, 2008, 01:07:24 PM »
Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol

For routine file stuff:

VB stuff=complex + cumbersome (bad)

Batch=simple + compact (good)







BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: command line syntax
« Reply #18 on: June 27, 2008, 06:39:29 PM »
Call me dense but I don't see what my quote has to with yours there... Can you spell it out? lol

For routine file stuff:

VB stuff=complex + cumbersome (bad)

Batch=simple + compact (good)









OK I see. I'd put some rebuttal here to simply defend my favourite programming language but the fact remains that when one knows how to make a "Simple & compact" Batch file for routine file stuff it is much better then a VBScript program for the same purpose.

But one must admit that VBScript is a much better solution then a C++ program :)
I was trying to dereference Null Pointers before it was cool.

Dias de verano

  • Guest
Re: command line syntax
« Reply #19 on: June 27, 2008, 11:40:39 PM »
But one must admit that VBScript is a much better solution then a C++ program :)

Well, yes, that is something that we can agree on, but I suppose I should confess that I have never really got my head around OOP, so my preferred VB era is that of VB6 and its script sibling.

llmeyer1000



    Intermediate

    Thanked: 1
    Re: command line syntax
    « Reply #20 on: June 28, 2008, 07:44:45 AM »
    Dizzzy,  I think that you have the answer to your problem in Reply #8 and a one line version of it in Reply #10.
    I prefer the one line version myself, but the split line version is supposed to be easier to read. Please let us know if you were able to implement any of the suggestions. Thank You in advance!  :)


    Please ... forgive me getting so far off your subject line, (I hope that this isn't construed as hijacking, as I think your question has been answered already.), but I would like to look further into the reasons for the wide screen display issue on this post.

    The thread is not extra wide for me either in Firefox 3 or IE6.

    That's interesting! Because I have a scroll bar at the bottom in "Internet Explorer 7   -   Version: 7.0.5730.13".
    I have to use the scroll bar to read all the replies in this post because the lines are about an inch(25-30 mm) too long for the screen. Dias, does your comment mean that you do not have a scroll bar to view the balance of the line(s).

    It seems that if there is one problem in one post on this site, that all replies on that page are affected. It is interesting to note that if I view only page 2 the posts on that page are OK, but if viewed under "ALL", they are wide also.

    I think(correction know) that it is caused by this line in Reply #7

    Code: [Select]
                                    wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."

    The line was preceded by 2 tab symbols, followed by a long line of code.
    I substituted 32 spaces in place of the 2 tabs as a test.

    I may be wrong, but I don't think that this site likes tabs, at least not in Version 7 of IE. It should be noted that you cannot type a tab charactor on this site. The only way to get one here is by pasting it in.

    CORRECTION:
    I am not wrong ... I am positive that this site does not handle tabs properly at least in IE: Version 7.

    The test code above previews perfectly as shown with the 32 spaces, but when I copy-paste 2 tabs in place of the spaces, the preview goes haywire. It appears that with the tabs in the code, the site is unable to word wrap, while it is OK with the spaces.

    One of 2 things needs to happen.
    1. Nathan should look into fixing the tab issue on this site.
    2. We should avoid pasting tabs into code on this site.

    Obviously, number 1 is the preferred solution! (Are you listening Nathan?)  ;)

    But, in the meantime, BC, would it be possible for you to go back to Reply #7 and replace the 2 tabs on the long line with 32 spaces. It seems to affect only long lines in my tests, so it may not be necessary to do that to every line to fix the screen in this post. Also the problem does not occur in the message body, only within code.

    We really need to prove or disprove the results of my tests, to give Nathan the right information, so that he can work out a solution.

    Dias de verano

    • Guest
    Re: command line syntax
    « Reply #21 on: June 28, 2008, 08:27:18 AM »

    The thread is not extra wide for me either in Firefox 3 or IE6.

    That's interesting! Because I have a scroll bar at the bottom in "Internet Explorer 7   -   Version: 7.0.5730.13".
    I have to use the scroll bar to read all the replies in this post because the lines are about an inch(25-30 mm) too long for the screen. Dias, does your comment mean that you do not have a scroll bar to view the balance of the line(s).

    I confirm that I do not have to use a horizontal scroll bar (there isn't one appearing). The whole width of the page is visible. I am using a 17 inch LCD monitor at its native resolution of 1280 x 1024 and in Firefox 3 with page zoom set to default (100%) I can see the blue vertical outline borders which are (gets ruler) approx 9mm in from the left screen edge and right vertical scrollbar respectively. This is both in single page view or "all". This is the case both in Firefox 3.0 and IE 6.0.2900.xpsp.080413-2111.

    Here is a screen shot scaled down to 1000 x 800










    « Last Edit: June 28, 2008, 08:51:25 AM by Dias de verano »

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: command line syntax
    « Reply #22 on: June 28, 2008, 09:10:03 AM »
    I replaced all tab characters in that code with four spaces. I don't notice anything weird in my version of IE.


    Also, I don't think it is the site handling tabs badly, since it works fine in Firefox and IE6. Rather MS probably changed the way tabs are handled (likely with some proprietary CSS extension as well, no doubt))
    But one must admit that VBScript is a much better solution then a C++ program :)

    Well, yes, that is something that we can agree on, but I suppose I should confess that I have never really got my head around OOP, so my preferred VB era is that of VB6 and its script sibling.

    VB6 has Class modules :). Took a while to learn, but now I have a large collection of reusable objects I can toss into any of my VB programs. I have .NET 2005, but it isn't VB anymore-

    what I should have specified is VBScript is a better solution then essentially any compiled program. Somehow, "Here, stranger, run this executable on your computer. Oh, but first disable your antivirus", seems less then helpful :)

    With C++ it isn't really the classes I have trouble getting my head around, it's the fact that the whole "++" of C++ is just a huge kludge on top of C. Also, I can't stand that over 90% of my code in C++ is just for data structures and pedantic memory management that really shouldn't be necessary. Thus my 5 year stint with VB6. Why, I often use the RtlMoveMemory function, so I can perform unnecessary memory management in VB instead of C++ anyway :)
    I was trying to dereference Null Pointers before it was cool.

    Dias de verano

    • Guest
    Re: command line syntax
    « Reply #23 on: June 28, 2008, 09:13:50 AM »
    I mainly use VB6 as a procedural language, sort of like QBasic for Windows.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: command line syntax
    « Reply #24 on: June 28, 2008, 09:31:06 AM »
    I mainly use VB6 as a procedural language, sort of like QBasic for Windows.

    I was doing that for a while after going straight from VB2 (which had no class modules) to VB6 (which does). I didn't really understand the whole concept of a class module, but then I made a few activeX controls, and the idea of the class module suddenly "clicked". speaking of classes and controls and such, ever been to VBAccelerator.com? I was working on a few controls that performed (or were intended to perform) what those controls do (namely the commandbar control). Needless to say development was frozen when I discovered the VBAccelerator versions.
    I was trying to dereference Null Pointers before it was cool.

    llmeyer1000



      Intermediate

      Thanked: 1
      Re: command line syntax
      « Reply #25 on: June 28, 2008, 01:49:36 PM »
      I confirm that I do not have to use a horizontal scroll bar (there isn't one appearing). The whole

      width of the page is visible. I am using a 17 inch LCD monitor at its native resolution of 1280 x

      1024 and in Firefox 3 with page zoom set to default (100%) I can see the blue vertical outline

      borders which are (gets ruler) approx 9mm in from the left screen edge and right vertical scrollbar

      respectively. This is both in single page view or "all". This is the case both in Firefox 3.0 and IE

      6.0.2900.xpsp.080413-2111.

      I do not think we can blame it all on my monitor/resolution settings, although that may be a

      factor since my resolution is set on only 1024 x 768 on my 17 inch monitor.

      The thing is, now that BC has replaced all of the tabs, my display is perfectly normal, with all the

      same settings still in place.

      I replaced all tab characters in that code with four spaces. I don't notice anything weird in my

      version of IE.

      I will test out my tab theory again:

      Here is BC's line of code as currently posted with 8 spaces, instead of the 2 tabs as before.
      Code: [Select]
              wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) &

      "." & extension2 & """..."

      Preview is normal!

      Here is BC's line of code as it was earlier posted with 2 tabs, instead of the spaces.
      Code: [Select]
      wscript.echo "found """ & fileloop.name & """. Finding:""" &

      FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."

      This is totally strange:
      Now, the preview is normal, except, the 2 tabs that I copied from notepad in place of the spaces are being ignored.

      I give it up for now, but I will state this:
      There is definitely something weird going on with tabs here!  ???  ???  ???

      Dizzzy

        Topic Starter


        Greenhorn

        Re: command line syntax
        « Reply #26 on: June 30, 2008, 09:22:56 PM »

        Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...


         :)

        I deliberately made mine verbose but you can fit it all in one line

        Code: [Select]
        for /f "delims==" %%A in ('dir /b /a-d *.%1') do if exist "%%~nA.%2" del "%%~nA.%2"&& echo deleted %%~nA.%2
        Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.


        Okay, Dias. Thanks for the command line code. I'm sorry my mindless and irrelevant comment came off as rude. Guess I was expecting this forum to be more like a grand jury than a jam session.  :o

        And thanks BC for all the effort to do this with filesystemobject scripting. My whole reason for wanting to avoid doing it that way is that if you include it in the program then everything else has to stop until it is done and if you make an executable out of it and then call it then almost the same thing. Even if you schedule it the system can slow down so a batch file to do it with commands is the only way to go.

        As for the extra wide screen its gone in this post reply mode. ...and now in view mode as well.