Ron, And I thought Steve's example was hard to figure out!!! (BIG GRIN) but I think I got it. Thanks.
Vic -----Original Message----- From: Ron Parker [mailto:[email protected]] Sent: Thursday, June 23, 2011 9:34 AM To: [email protected] Subject: Re: Checking the WE version 'Alternatively, just because I can: Set VersionCheck = New RegExp VersionCheck.pattern="\..*\..*\." : If VersionCheck.Execute(Version).Count Then ' Stuff for version 7.5.1.0 or above Else ' Stuff for older versions End If ' This works because the regular expression pattern looks for a period, ' followed by zero or more characters, followed by a second period, ' followed by zero or more characters, followed by a third period. ' In other words, it matches any string that contains at least three periods. On 6/23/2011 8:53 AM, Stephen Clower wrote: > Vic, > > Use something like the following: > > Dim periodCount : periodCount = 0 > for i = 1 to len(version) > If mid(version, i, 1) = "." Then > periodCount = periodCount + 1 > End If > Next > > If periodCount = 3 Then ' This is at least WE 7.5.1.0. You can use the > new Version object if needed here. > ... > Else > StopScript ' Not WE 7.5.1.0. > End If > > > Regards, > Steve > > > On 6/23/2011 8:12 AM, Vic Beckley wrote: >> Hi all, >> >> I have an app that I am writing that requires WE 7.5.1.0. In my app I >> need >> to make sure that 7.5.1.0 is running and, if not, stop the app. With >> the new >> version object, this is a simple process, but I can't use that because >> anything prior to 7.5.1.0 will not even have that object. In that case, >> would my app error out? How can I write a sub to check for the >> version and >> stop the app for anything less than 7.5.1.0. I know I could check for >> that >> specific version, but I don't want to update it every time a newer >> version >> comes out. You can't do numeric comparisons on the ApplicationVersion >> property because it is a string, right? Any suggestions? >> >> Vic >> >
