variable definition help

Tony Zuccolotto anthony.zuccolotto at pstnet.com
Fri Aug 1 17:04:16 UTC 2003


Natalie,

 

I would expect that the error you get should show you the script line
that contains the variable that is not defined.   The variable will
likely exist in either an Inline object you created or in the 'User
Script' area.   It is common to get this error if you have either not
declared a variable, or perhaps misspelled one instance of a variable
that you did declare.   For example

 

Dim myVariable As String

 

myVariable = "Hello"

mVariable = "Hello"  ' mVariable is undeclared

 

If it is the case that you need to declare a variable then you need to
use the Dim statement as shown above.   If you only need the variable's
value to exist within one invocation of a procedure you can declare the
variable within an Inline object that you drop on the procedure.   If
you need to variable to maintain it's value over multiple procedure
calls or over the life of the entire experiment then you need to declare
it 'globally' by putting your Dim statement for the variable on the User
tab of the Script window (i.e. which is there specifically to allow you
to define global variables, constants and entire subroutines/functions
that can be accessed from anywhere else in your experiment).

 

To show the Script window choose View|Script from the E-Studio menubar.
Once the window is shown click on the User tab at the bottom and you can
type directly into the window.   Note that the other tab is labeled
'Full' and it allows you to see the full/complete script that E-Studio
generated from your graphical specification of the experiment when you
hit the Generate or Run button (the 'Full' script tab is read-only since
E-Studio rewrites the full script every time you generate or run the
experiment).

 

Hope that helps.

Tony

 

*** DISCLAIMER: ALL VIEWS EXPRESSED ARE MY OWN AND DO NOT NECESSARILY
REFLECT THOSE OF PSYCHOLOGY SOFTWARE TOOLS *** 

Anthony P. Zuccolotto

Vice President

Psychology Software Tools, Inc.

2050 Ardmore Boulevard

Suite 200

Pittsburgh, PA 15221-4610

Phone     412-271-5040

FAX       412-271-7077

Email     anthony.zuccolotto at pstnet.com

Internet  http://www.pstnet.com <http://www.pstnet.com/> 

 

 

-----Original Message-----
From: Drtweets19 at cs.com [mailto:Drtweets19 at cs.com] 
Sent: Friday, August 01, 2003 11:33 AM
To: eprime at mail.talkbank.org
Subject: variable definition help

 

Hey everyone, First i would like to thank all of you for your help thus
far.  

We have one question.

We constantly get the error that states "Variable not defined"
Basic question, how do u define variables.  We've tried every
compilation we could think of and we get the same result; Variable not
defined.

Please help

Thanx,

Natalie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20030801/9e4385e8/attachment.htm>


More information about the Eprime mailing list