|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Today @ 1:49:23 PM
Posts: 288,
Visits: 738
|
|
(This might apply to any EP version, but I noticed it when testing EP2.)
I am writing some test programs to explore the capabilities of EP1.2 vs. EP2. I want the results to include a record of which version the program was run under (without requiring me to type that into the source code, because I might forget as I import/export code between versions). So, I used Basic.Version$. According to the E-Basic online help in both EP1.2 and EP2, "This function returns the major and minor version numbers in the format major.minor.BuildNumber, as in '2.00.30.'"
However, I get the same result for EP 1.2.1.841 and 2.0.8.22. Namely, for both versions, Basic.Version$ returns 2.25.1803, which makes no sense at all. So what am I missing?
Thanks,
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 9/5/2008 8:56:39 AM
Posts: 8,
Visits: 11
|
|
Hi David,
this is just a guess, but I suspect that Basic.Version$ echoes the version and build number of E-Basic rather than E-Prime. If this was true, it would mean that both E-Prime 1.2 and 2.x are still running the same old E-Basic engine. But as I said, I'm just guessing.
Best,
~Dave
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 5:00:06 PM
Posts: 569,
Visits: 1,238
|
|
| Basic.Version$ is the version of the underlying scripting engine and will not change. For the runtime version, as of EP2, one can use... Dim x As RteVersion Set x = Rte.Version Debug.Print x.Major & "." & x.Minor & "." & x.Internal & "." & x.Build In fact, every object has a Version property. So you could replace Set x = Rte.Version above with TrialList.Version and get the specific version for that component. I understand this has not been documented publically but I recently did see a draft for the inclusion of the Rte object additions and it will be available shortly. In addition, the logging of the runtime version and e-studio generated version will soon be automatically added to the Context/datafile. The use of these version properties are useful for informational purposes when replicating a study. There is not a lot of conditional possibilities that can be performed with them because they would cause a runtime error. For example... If Rte.Version.Major >= 2 Then Stimulus.ForeColor = Color.WhiteSmoke Else Stimulus.ForeColor = CColor("red") End If The above would work fine in EP2, but since EP1 does not have a "Color" object (nor a WhiteSmoke property) you would end up with a compiler error if you transfer the script to EP1. Instead, you can use compile time conditionals similar to other development languages. KB1335 - FEATURE: E-Run provides for automatic version Const flags #If RUNTIME_VERSION_MAJOR >= 2 Then Stimulus.ForeColor = Color.WhiteSmoke #Else Stimulus.ForeColor = CColor("red") #End If
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Today @ 1:49:23 PM
Posts: 288,
Visits: 738
|
|
Brandon,
Thank you, thank you. This could be very useful in the future, and it almost solves my current problem. Unfortunately, I want to compare EP1.2 with EP2, and as you explained Rte.Version is not available in EP1.2. And since preprocessor constants (#Const) can only be used in #If... #End If directives, I cannot directly use RUNTIME_VERSION_MAJOR, etc., to record the version of EP in use (I tried in both EP1.2 and EP2 and just got an "Unknown function" error). I could, of course, craft a bunch of #If.. #End If directives to construct the version number for output, but this seems too much trouble for my modest program, so I will just go back to typing in the version number and hope I don't make a mistake.
Thanks again,
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Today @ 1:49:23 PM
Posts: 288,
Visits: 738
|
|
Once I thought this over more fully, I found a way to use all this that is Good Enough for my present purposes. So I owe you my thanks once again.
-- David McFarlane, Professional Faultfinder
|
|
|
|