Hi Tim, Just a thought. Even for numeric values, try declaring them within quotation marks e.g.
> const NavDir_Up = "1" > Const NavDir_Down = "2" I used to have several such constants with integer values at the top of my GoldWave script, defined this way. Darren On 08/09/2008, Tim Burgess <[EMAIL PROTECTED]> wrote: > Doug, > > OK, my error. I included a file with quite a bit more in it than your > example (which works flawlessly- apologies). The error arises if I declare > two constants in the included file: > > ' Constants within an included file > const NavDir_Up = 1 > Const NavDir_Down = 2 > > It's almost as if the individual constant declarations aren't complete. I > can't see that there's a statement separator character required between the > declarations, but I'm new to VB Script, so any advice welcome. > > Best wishes. > > Tim Burgess > Raised Bar Ltd > Phone: +44 (0)1827 719822 > > Don't forget to vote for improved access to music and music technology at > > http://www.raisedbar.net/petition.htm > > -----Original Message----- > From: Doug Lee [mailto:[EMAIL PROTECTED] > Sent: 08 September 2008 16:52 > To: [email protected] > Subject: Re: .VBF files and WE scripts > > Not sure what's going on there. I actually ran that combination of files > before sending them with the command > > cscript //nologo c2.vbs > > and it worked, printing the value of the constant. > > > On Mon, Sep 08, 2008 at 04:38:09PM +0100, Tim Burgess wrote: > Hi Doug, > > Tried this method within a .vbs script and got a run-time error saying that > an "End" was expected on the line with the ExecuteGlobal. Any ideas? > > > Best wishes. > > Tim Burgess > Raised Bar Ltd > Phone: +44 (0)1827 719822 > > Don't forget to vote for improved access to music and music technology at > > http://www.raisedbar.net/petition.htm > > -----Original Message----- > From: Doug Lee [mailto:[EMAIL PROTECTED] > Sent: 08 September 2008 12:36 > To: [email protected] > Subject: Re: .VBF files and WE scripts > > Here's a way to do constants, and while I'm at it, a clean way to include > stuff, based on the cool article Darren pointed out. > > Btw, I propose the "include" command below, possibly with the addition of > Unicode handling (fso.openTextFile takes an optional parameter for this), be > added to the WE scripting model's Application object, thus making the line > > include "lib1.vbs" > > work just as if it were part of VBScript. This should also make > > include("lib1.js") > > work from Javascript. > > Here are two files, the first defining a constant, and the second including > the first and using the constant. I tested these stand-alone, not as WE > scripts; so beware the wscript.echo call if you try this as a WE script. > The principal will work in either environment though. > > *** begin file c1.vbs *** > const WindowClass = "TComboBox" > *** end file c1.vbs *** > > *** begin file c2.vbs *** > include "c1.vbs" > wscript.echo WindowClass > > sub include(fname) > dim fso : set fso = createObject("Scripting.FileSystemObject") > dim oFile : set oFile = fso.openTextFile(fname, 1) > dim sContents : sContents = oFile.readAll > oFile.close > executeGlobal sContents > end sub > *** end file c2.vbs *** > > On Mon, Sep 08, 2008 at 12:19:41PM +0100, Tim Burgess wrote: > Hi Darren, > > That's certainly a work-around - thanks. Now all I need is a method of > defining constants, but VB Script doesn't seem to allow this either (yuk). > > > Best wishes. > > Tim Burgess > Raised Bar Ltd > Phone: +44 (0)1827 719822 > > Don't forget to vote for improved access to music and music technology at > > http://www.raisedbar.net/petition.htm > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 08 September 2008 11:04 > To: [email protected]; Doug Lee > Subject: Re: .VBF files and WE scripts > > Tim and DOug, > > This wiki article might help. > > https://www.gwmicro.com/bitweaver/articles/read.php?article_id=1 > > Darren > > On 08/09/2008, Doug Lee <[EMAIL PROTECTED]> wrote: >> Other may have better ideas, but mine is this: Make a wsf that groups >> all your support source into a single object, and just keep the master >> code in the actual script module. Then access your support code as >> you would any other shared object in a WE script. This approach lets >> you build a library and frees your individual scripts from clutter, >> though admittedly it's not quite as convenient as being able to >> include specific library modules in specific scripting projects. >> Alternatively, if your code library nicely breaks down into a few >> functional areas, you could make each its own shared object. This is >> probably more along the lines of the GW scripting philosophy, because >> it eases sharing of features on demand. It works well when the >> features you've coded apply across several projects, but the first >> approach will probably work better for code that is massive but >> specific to one project. >> >> On Mon, Sep 08, 2008 at 07:22:13AM +0100, Tim Burgess wrote: >> OK, so there's no method of modularising the code for a large amount >> of source? >> >> >> Best wishes. >> >> Tim Burgess >> Raised Bar Ltd >> Phone: +44 (0)1827 719822 >> >> Don't forget to vote for improved access to music and music technology >> at >> >> http://www.raisedbar.net/petition.htm >> >> -----Original Message----- >> From: Ron Parker [mailto:[EMAIL PROTECTED] >> Sent: 08 September 2008 01:45 >> To: [email protected] >> Subject: Re: .VBF files and WE scripts >> >> >> Aaron, you're a bit wrong here. >> >> We specifically look for encrypted scripts in wsf files, but all other >> wsf files get passed to Windows Script Host. They'll work with WE, >> but only in the way that any external program will. That is, they'll >> have to create a WindowEyes.Application object and identify themselves >> as a script, and they won't have access to any of the methods of the > Script object. >> >> Aaron Smith wrote: >>> Tim, >>> >>> Are you referring to WSF files? If so, then, yes, you can use those. >>> You'll note the extension to an encrypted script file ends in .WSF. >>> VBF files, from what I've gathered, are Outlook Free/Busy files. >>> >>> You might, however, investigate the Shared Objects feature of >>> Window-Eyes script. This is a built-in method of being able to share >>> objects across scripts. In fact, it's the main point of the GW >>> Toolkit script. >>> >>> Aaron >>> >>> Tim Burgess wrote: >>>> Hi, >>>> >>>> Is the use of .vbf files supported with Window Eyes? I'd like to >>>> modularise a large amount of code, if possible. >>>> Best wishes. >>>> >>>> Tim Burgess >>>> Raised Bar Ltd >>>> PO Box 4442 >>>> Atherstone >>>> Warwickshire >>>> CV9 9AT >>>> >>>> Phone: +44 (0)1827 719822 >>>> Email: [EMAIL PROTECTED] >>>> Web: http://www.raisedbar.net >>>> >>>> Don't forget to vote for improved access to music and music >>>> technology at >>>> >>>> http://www.raisedbar.net/petition.htm >>>> >>>> >>> >> >> >> -- >> Doug Lee, Senior Accessibility Programmer SSB BART Group - >> Accessibility-on-Demand mailto:[EMAIL PROTECTED] >> http://www.ssbbartgroup.com "While they were saying among themselves >> it cannot be done, it was done." --Helen Keller >> > > -- > Doug Lee, Senior Accessibility Programmer SSB BART Group - > Accessibility-on-Demand mailto:[EMAIL PROTECTED] > http://www.ssbbartgroup.com "While they were saying among themselves it > cannot be done, it was done." --Helen Keller > > -- > Doug Lee, Senior Accessibility Programmer SSB BART Group - > Accessibility-on-Demand mailto:[EMAIL PROTECTED] > http://www.ssbbartgroup.com "While they were saying among themselves it > cannot be done, it was done." --Helen Keller > >
