Coding in E-Prime
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Coding in E-Prime Expand / Collapse
Author
Message
Posted 9/4/2008 2:36:59 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/10/2008 3:59:05 PM
Posts: 4, Visits: 19
I am new to using E-Prime but have background in other programming languages such as Java. I am working with an experiment where I am trying to make a majority of the 'work' done by the program (versus doing calculations outside of the program and inputting a large amount of extra numbers and text to support the stimuli presentation) in order to allow the users to easily change the stimuli within the program. However, I am not sure how much of what I would like to do is allowed by the E-Prime language. I have had difficulty finding appropriate resources as I am working on this file for a Professor and do not have access to some resources on the website which require email login. I am not sure if some of what I want to do exists within EBasic or where I might find it, as the Help Files within the program are very helpful if you already know the syntax and want to find out what it does, but not very helpful for determining if the syntax exists.

A brief overview of what I am trying to do within the experiment
The experiment presents the words one at a time with a specific duration based on word length and monitor refresh rate. We would like to be able to input the sentence into the List object and have the program determine the duration for each word displayed on the screen. The general procedure I would like to follow is this:
1. Input the stimuli sentences into the List Object
2. Split/Explode the sentence string into arrays of individual words
3. Calculate the length of each word in the sentence, then calculate the duration
4. Have the words stored in the array shown one at a time for their calculated duration

This would be done for multiple sentences of varying length, preferably using loop structure.

Now for some general questions:
-Am I asking too much from E-Prime?
-Is there an easier way to do some of this within the Gui versus InLine code?
-If not, what are some of the commands I would need to use in order to get the sentences from the List into a String in order to do the duration calculations?
-I have been able to find commands such as WordCount, but is there an easy way to split the sentence strings into words(based on a marker such as a space, or slash)? I have not been able to find a Split command, but I don't know if it is called by something different within E-Prime if it does exist.
-What commands might I need for successful interaction between my InLine code and the List and TextDisplay objects.

I would appreciate any general help that can be provided, and apologize for not asking more specific questions. I am looking for a greater understanding on what is possible before I try to dive into code that is not feasible.

Thanks!
Post #2053
Posted 9/4/2008 3:42:07 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Today @ 1:49:23 PM
Posts: 288, Visits: 738
bethrow (9/4/2008)
I am new to using E-Prime but have background in other programming languages such as Java.

Welcome to the club!

Now for some general questions:
-Am I asking too much from E-Prime?

Probably not.

-Is there an easier way to do some of this within the Gui versus InLine code?

Probably not.

Here's the key: E-Basic is just a dialect of Microsoft VisualBasic with some special objects already defined. So, within some broad limits, anything you can do with VB you can also do with EB. You might want to try a good VB manual, I still have not found one myself but I hear that the old "VB and VBA in a Nutshell" from O'Reilly can help.

Here's the second key: The real documentation for E-Basic is not in the printed manuals, it is online in the E-Basic Help file. Not the sort of reference that you can easily browse through, but it is the best place to find out what you can really do with E-Basic.

-- David McFarlane, Professional Faultfinder
Post #2054
Posted 9/5/2008 8:55:42 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: Today @ 5:00:06 PM
Posts: 569, Visits: 1,238
EP2 has introduced a SplitStrings function that is very similar to the VBA Split function, the method to work in EP1 and EP2 would be the Item$ and ItemCount function and refer to the E-Basic Help for more info.  To quickly access the E-Basic help, press F1 in any script window in E-Studio.

Take a look at the attached and should get you started.

  Post Attachments 
BreakUpSentence.es (3 views, 13.02 KB)

Post #2056
Posted 9/5/2008 8:58:19 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
You might also want to have a look at this script available from the STEP-site: Masked Reading Script.

Best,
~Dave
Post #2057
Posted 9/5/2008 12:52:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/10/2008 3:59:05 PM
Posts: 4, Visits: 19
Thank you for the advice and assistance!
Post #2059
Posted 9/5/2008 2:31:48 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/10/2008 3:59:05 PM
Posts: 4, Visits: 19
Brandon.Cernicky (9/5/2008)
EP2 has introduced a SplitStrings function that is very similar to the VBA Split function, the method to work in EP1 and EP2 would be the Item$ and ItemCount function and refer to the E-Basic Help for more info. To quickly access the E-Basic help, press F1 in any script window in E-Studio.

Take a look at the attached and should get you started.


Thank you, especially, for this code. Once I saw it, it made a lot of sense and I was able to get my experiment working beautifully. Thanks again!
Post #2060
« Prev Topic | Next Topic »


Permissions Expand / Collapse