viewpoint-particle

Author Topic: ****************** WinBatch+Comiler 2017C Beta released **********************  (Read 272 times)

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
We have released WinBatch+Compiler 2017c beta.

Customers on an active maintenance plan may download the beta version of the software from the download page.  Find beta software in the Alternatives
download list.

http://www.winbatch.com/download.html

If you do not have a current license and are interested in getting updated, please visit our software purchase page. You can easily order online.

https://commerce.winbatch.com
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
WB 2017C Dec 28, 2017

  DLL 6.17cqc First showing up in WB 2017C
   
   Replaced copyrights, icons and embedded images.

   Modified uninstall program to account for multiple paths in the
   TEMP and TMP environment variables.
   
   WinBatch Studio:
      Fixed unhandled exception in WIL file type syntax coloring.
      Fixed memory corruption problem in output window implementation.
     
      This release of WinBatch Studio includes the new Lexical Analyzer module:   
        Added an 'Analyze' menu item to the debug menu bar menu. Select this menu item to
        invoke the Syntax Analyzer on the current foreground document. The Syntax Analyzer
        tool scans the current script for syntax errors without actually executing the script.
        Any errors are displayed in the "Syntax Analyzer" tab of a WinBatch Studio output
        window automatically displayed by the Analyzer.
         
        Each error line in the Analyzer window represents one error.  A single line in the
        script can produce more than one error.  Error lines consist of a full path-name of the
        file being analyzed, the row and column numbers of the error's location in the script,
        the word "error" or "warning", an error number, and a brief error description.

        Using your mouse to left click on an error in the Syntax Analyzer window will set the
        WinBatch Studio input cursor to the beginning of the line in the current script that
        contains the error.

        A few thing to remember when using the Syntax Analyzer:
          Variable values are not checked because the script is not executed.
          The Analyzer cannot determine the resulting syntax of substituted variables.
          The grammar of function parameters is checked but not the correctness of parameter
          values.
          The Analyzer can be used on WIL menu files but menu names line generate "unexpected
          item found online" errors.  Ignore these errors.
          Files included in the current script using an "#include" statement are not analyzed.
          WIL function parameter counts ARE checked.
          Extenders are not loaded so extender function parameter counts are not checked.
          WinBatch function parameter counts are not checked.
 
       
   WinBatch Compiler:     
      This release of the WinBatch Compiler also includes the Lexical Analyzer module:
        The Compiler's main dialog window contains a new "Analyze source for errors" checkbox.
        When this check box is checked, the compiler will use the Lexical Analyzer module to
        scan the target script for errors before compilation begins. 
       
        If any errors or warnings are found, the Compiler can display a dialog showing a list of
        errors and warning. Press this dialog's "Continue" button to proceed with the
        compilation or press the "Cancel" button to either return to the main Compiler window or
        exit the compiler when the compiler starts with a command line target. In all cases
        pressing the "Cancel" button prevents the target from being compiled.

        The "Analyze source for errors" checkbox option is global.  Once it is checked, syntax
        checking is performed on all compiles by the WinBatch+Compiler user until it is
        unchecked.
       
        If the "Analyze source for error" option is selected, the compiler is invoked with the
        target script as a command line parameter, and the target script's "cmp" file contains
        the "silent=1" option; the Compiler generates a text file of any found errors.  The
        syntax error dialog is not displayed.

        The compiler also generates an error file instead of displaying the syntax error dialog
        when it is invoked with a "cmplst" file as a command line parameter.

        In both instances, the error file name is the target script's file name with a time
        stamp and a ".txt" file extension.  The file is placed in the target's location on the
        file system.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


kdmoyers

  • Full Member
  • ***
  • Posts: 194
woo hoo! this is going to be a big time saver!!
-K
The mind is everything; What you think, you become.

mhall

  • Jr. Member
  • **
  • Posts: 82
Wow! I look forward to giving this a go - thanks!

bottomleypotts

  • Newbie
  • *
  • Posts: 10
Well I feel dumb, because I can't see a download link on the download page. And I don't see an Alternatives download list either.

kdmoyers

  • Full Member
  • ***
  • Posts: 194
OK, I have a strangeness:  Analyzer gives "error 5046: Variable name expected" on line 2
The program works as expected, I don't think it's a real error.
Code: Winbatch
    #definefunction fred(a)
      bhash = *ptrglobal(ahash) ; a global Scripting.Dictionary object
      bhash.Add("X",a)
      return 1
    #endfunction

    ahash = ObjectOpen("Scripting.Dictionary")  
    ptrglobaldefine(ahash)

    ahash.Add("Y","34")

    fred("12")

    foreach q in ahash
      Message(q, ahash.Item(q))
    next

    exit
 
The mind is everything; What you think, you become.

JTaylor

  • Pundit
  • *****
  • Posts: 815
    • Data & Stuff Inc.
Maybe it *thinks* it is a real error and therefore has become one  ;)

Jim

kdmoyers

  • Full Member
  • ***
  • Posts: 194
So maybe we call that bug a cricket?  ;)
The mind is everything; What you think, you become.

mhall

  • Jr. Member
  • **
  • Posts: 82
Well I feel dumb, because I can't see a download link on the download page. And I don't see an Alternatives download list either.

Don't feel too dumb - I've asked too many dumb questions here, so I wasn't gonna ask that, but I couldn't find it either!  :D

You actually have to click the Download button for WinBatch+Compiler on the download page, then enter your license info and on *that* page, you'll see the Alternates.

~Micheal

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
OK, I have a strangeness:  Analyzer gives "error 5046: Variable name expected" on line 2
The program works as expected, I don't think it's a real error.
Code: Winbatch
    #definefunction fred(a)
      bhash = *ptrglobal(ahash) ; a global Scripting.Dictionary object
      bhash.Add("X",a)
      return 1
    #endfunction

    ahash = ObjectOpen("Scripting.Dictionary")  
    ptrglobaldefine(ahash)

    ahash.Add("Y","34")

    fred("12")

    foreach q in ahash
      Message(q, ahash.Item(q))
    next

    exit
 

Thanks for taking the time to try the beta version.  We really appreciate it.  This bug will be fixed in the release version.   
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


kdmoyers

  • Full Member
  • ***
  • Posts: 194
I had a feeling the Ptr functions might be tricky.  (smile)
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
Overloaded operators always require a little more context to lexically analyze so there are more conditions and it is easier to miss something.     Pointers were shoehorned into the WIL parser way back when but they were built into the lexical analyzer from the beginning, so the implementations diverge some with regard to pointers. 

These two facts make pointers a likely candidate for insect invasions.  I guess this is one of the reasons why we have beta releases.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


kdmoyers

  • Full Member
  • ***
  • Posts: 194
I dunno if this is an example of the same thing, but this code gets "error 5041: Operand or expression expected" on the last line.
It actually executes correctly.

Code: Winbatch
    oADO = ObjectOpen("ADODB.Connection")
    ptrGlobalDefine(oADO)
    poADO = ptrGlobal(oADO)
    dbcon1 = 'DRIVER={SQL Server};SERVER=SQXL;UID=someuser;PWD=somepassword;DATABASE=G'
    *poADO.Open(dbcon1)
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
Its a variation on the same issue.  Your latest example will be added to our regression test suite to make sure it is and stays fixed.

Thanks again.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
Turned out to be related but requiring an additional code change so you get a double thank you.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


kdmoyers

  • Full Member
  • ***
  • Posts: 194
The following code gets a "error 5054: Object member name expected" on the two objRE.execute calls.
Is that correct? It executes fine.
-Kirby

Code: Winbatch
    #definefunction GetChromeDLFolder()

      ; folder tree to search for Preferences files
      prefroot = "C:\Users\":environment("NAME"):"\AppData\Local\Google\Chrome\User Data\"
 
      ; the downloads folder to return if no custom setting found
      dfold = "C:\Users\":environment("NAME"):"\Downloads"
 
      ; use the "File and Folder Search" extender
      AddExtender('WWFAF44I.DLL', 0, 'WWFAF64I.DLL')
      fsRecurse = 16  ; Look in sub directories
     
      ; We assume the youngest Preferences file is the active one
      thisfile = ""
      latest = "0000:00:00:00:00:00"
      fsHandle = fafOpen(prefroot, "Preferences", fsRecurse)
      While 1
        sFound = fafFind(fsHandle)
        If sFound == "" Then Break
        thistime = FileYmdHms(sFound)  
        if thistime > latest then thisfile = sFound
      EndWhile
      fafClose(fsHandle)
 
      if thisfile == "" then errorevent(-2,7000,"No Chrome Preferences file found")
 
      ;message("latest", thisfile)
 
      ;this file is a giant mess of json
      prefsdata = fileget(thisfile)
      ;next we parse the json with regex (gasp!)
 
      objRE = ObjectOpen("VBScript.RegExp")
      objRE.IgnoreCase = 0 ; case sensitive
      objRE.MultiLine  = 0 ; no multiline mode
      objRE.Global     = 0 ; match only first occurrance
 
      objRE.Pattern    = '"download":\{[^}]+\}'
      matches = objRE.execute(prefsdata)
      if matches.count
 
        block = matches.item(0).value ; the whole match
 
        objRE.Pattern    = '"default_directory":"([^"]+)"'
        matches = objRE.execute(block)
        if matches.count
 
          block = matches.item(0).submatches.item(0) ; 1st submatch
          dfold = strreplace(block,"\\","\")
       
        endif
 
      endif
 
      objRE = 0 ; clear the regexp object
 
      return dfold
 
    #endfunction

    message("Chrome download directory is",GetChromeDLFolder())

    exit
 
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
Argh. You found another one.  You are going to expect a spot on the payroll pretty soon. 

The Scanner classifies the token "Execute" as a WIL delimiter.   WIL delimiters are things like operators, constants, objects, and functions.    The Analyzer knows that the listed delimiter types other than some operators can be part of a sub-object reference hierarchy ( x.y ).  However, five delimiters are not classified as any of the previously listed delimiter types.  These five go back to the days before WinBatch was called WinBatch and were just flat out missed in the logic of the object syntax checking methods of the Analyzer. 

This oversight will be corrected and thanks again.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


kdmoyers

  • Full Member
  • ***
  • Posts: 194
Yay! my reward is a great Syntax Analyzer!
The mind is everything; What you think, you become.

kdmoyers

  • Full Member
  • ***
  • Posts: 194
I should say, while I was trying to break it, the Analyzer found a big honkin missing endif in an important piece of running code. Wow.
I'm a little scared to fix it, for fear the fix will actually break the program!  Ironic.
My point is, the Analyzer is already paying dividends to me!
-Kirby
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 2287
    • WinBatch
As you can well imagine, we have literally thousands of WIL scripts on various computers.   Some of these scripts are used for dev-ops, regression testing, and back-office processing.   Others are user submissions or part of the WinBatch distribution.  Without naming names the syntax analyzer did find some errors...     

I see the syntax analyzer as having at least two roles and maybe more.  During initial script writing, it can identify typos and other mistakes before you ever run the script.  This can be a significant time saver for obvious reasons.  The other role is finding errors in scripts that appear to work but have hidden bugs.   This can happen when script logic contains conditionally executed blocks and the condition required to execute the block hasn't been encountered yet.  This can be at the minimum an embarrassment preventer or more significantly a job saver
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates