Basic.Version$
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Basic.Version$ Expand / Collapse
Author
Message
Posted 7/3/2008 5:31:57 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Today @ 6:03:05 PM
Posts: 229, Visits: 607
(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
Post #1752
Posted 7/4/2008 6:39:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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
Post #1753
Posted 7/7/2008 8:40:11 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: Yesterday @ 10:30:44 PM
Posts: 549, Visits: 1,198
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

Post #1755
Posted 7/7/2008 2:39:43 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Today @ 6:03:05 PM
Posts: 229, Visits: 607
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
Post #1760
Posted 7/8/2008 4:58:19 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Today @ 6:03:05 PM
Posts: 229, Visits: 607
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
Post #1764
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 11:24pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.062. 10 queries. Compression Disabled.