listing of e-basic commands - talkbankstep.talkbank.org/materials/ppt/ebasic.doc · web viewe-basic...

12
E-Prime Reference Guide Chapter 2: E-Basic Chapter 1 Chapter 1 : E-Basic : E-Basic E-Basic is the complete scripting language underlying E-Prime. E-Basic is almost identical to Visual Basic for Applications, with additional commands inserted to accommodate the needs of empirical research. For detailed information concerning E-Basic commands, refer to the on-line Help. The E-Basic on-line Help may be accessed via the E-Prime menu. 1.1 Listing of E-Basic Commands The following is a list of E-Basic commands grouped by type. These commands may be used in an InLine object, and are used by E-Studio to convert object specifications into script. 1.1.1 Audio Control SoundBuffer.Continue (method) SoundBuffer.Play (method) SoundDevice.CreateBuffer (method) SoundOut.Play (method) SoundBuffer.Load (method) SoundOut.Run (method) SoundDevice.Open (method) Slide.Stop (method) SoundBuffer.Pause (method) SlideSoundOut.Stop (method) Slide.Play (method) SlideState.Stop (method) SlideSoundOut.Play (method) SoundBuffer.Stop (method) SlideState.Play (method) SoundOut.Stop (method) 1.1.2 Compiler Control #Const (directive) Inline (statement) #If... Then... #Else (directive) Option Default (statement) () (keyword) Option Explicit (statement) _ (keyword) 1.1.3 Data Logging Summation.AddObservation (method) DataFile.Open (method) DataFile.Close (method) Summation.RemoveObservation (method) DataFile.Convert (method) FeedbackDisplay.Reset (method) DataFile.Flush (method) Summation.StdDevP (method) Summation.Max (method) Summation.StdDevS (method) Summation.Mean (method) Summation.Total (method) Summation.Min (method) Summation.VarP (method) Summation.N (method) Summation.VarS (method) Page 1

Upload: doliem

Post on 12-Jul-2019

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

Chapter 1Chapter 1: E-Basic: E-BasicE-Basic is the complete scripting language underlying E-Prime. E-Basic is almost identical to Visual Basic for Applications, with additional commands inserted to accommodate the needs of empirical research. For detailed information concerning E-Basic commands, refer to the on-line Help. The E-Basic on-line Help may be accessed via the E-Prime menu.

1.1 Listing of E-Basic CommandsThe following is a list of E-Basic commands grouped by type. These commands may be used in an InLine object, and are used by E-Studio to convert object specifications into script.

1.1.1 Audio ControlSoundBuffer.Continue (method) SoundBuffer.Play (method)SoundDevice.CreateBuffer (method) SoundOut.Play (method)SoundBuffer.Load (method) SoundOut.Run (method)SoundDevice.Open (method) Slide.Stop (method)SoundBuffer.Pause (method) SlideSoundOut.Stop (method)Slide.Play (method) SlideState.Stop (method)SlideSoundOut.Play (method) SoundBuffer.Stop (method)SlideState.Play (method) SoundOut.Stop (method)

1.1.2 Compiler Control#Const (directive) Inline (statement)#If... Then... #Else (directive) Option Default (statement)() (keyword) Option Explicit (statement)_ (keyword)

1.1.3 Data LoggingSummation.AddObservation (method) DataFile.Open (method)DataFile.Close (method) Summation.RemoveObservation (method)DataFile.Convert (method) FeedbackDisplay.Reset (method)DataFile.Flush (method) Summation.StdDevP (method)Summation.Max (method) Summation.StdDevS (method)Summation.Mean (method) Summation.Total (method)Summation.Min (method) Summation.VarP (method)Summation.N (method) Summation.VarS (method)

Page 1

Page 2: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.4 Data Type ConversionAsc (function) CSng (function)AscB (function) CStr (function)AscW (function) CString (function)CBool (function) CVar (function)CColor (function) CVDate (function)CColorPalette (function) CVErr (function)CCur (function) Fix (function)CDate (function) Hex (function)CDbl (function) Hex$ (function)Chr (function) Int (function)Chr$ (function) IsDate (function)ChrB (function) IsNumeric (function)ChrB$ (function) Oct (function)ChrW (function) Oct$ (function)ChrW$ (function) RGB (function)CInt (function) Str (function)CLng (function) Str$ (function)CLogical (function) Val (function)

1.1.5 Data Type Conversion: CastingCCanvas (function) CPortInputDevice (function)CCellSpec (function) CPortResponseData (function)CContext (function) CRandomOrder (function)CCycles (function) CRandomReplaceOrder (function)CDataFile (function) CResponseData (function)CDeletion (function) CResponseDataCollection (function)CDevice (function) CRteCollection (function)CDeviceManager (function) CSamples (function)CDisplayDevice (function) CSequentialOrder (function)CDisplayEchoClient (function) CSerialDevice (function)CDisplayEchoClientCollection (function) CSlide (function)CEchoClient (function) CSlideImage (function)CExplicitOrder (function) CSlideSoundOut (function)CExplicitOrderByName (function) CSlideState (function)CFactor (function) CSlideStateCollection (function)CFactorSpace (function) CSlideStim (function)CFactorTable (function) CSlideStimCollection (function)CFeedbackDisplay (function) CSlideText (function)CImageDisplay (function) CSlideVisualStim (function)CInputDevice (function) CSoundBuffer (function)CInputHistoryManager (function) CSoundBufferCollection (function)CInputMask (function) CSoundDevice (function)CInputMaskManager (function) CSoundOut (function)CKeyboardInputDevice (function) CSRBoxEchoClient (function)CKeyboardResponseData (function) CSRBoxEchoClientCollection (function)CLatinSquares (function) CSRBoxInputDevice (function)CMouseInputDevice (function) CSRBoxResponseData (function)CMouseResponseData (function) CStimDisplay (function)CNoDeletion (function) CSummation (function)COffsetOrder (function) CTextDisplay (function)COrder (function) CTimed (function)CPermutationOrder (function) CTrigger (function)CPickOne (function)

Page 2

Page 3: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.6 Date and TimeDate (function) Month (function)Date (statement) Now (function)Date$ (function) Second (function)Date$ (statement) Time (function)DateAdd (function) Time (statement)DateDiff (function) Time$ (function)DatePart (function) Time$ (statement)DateSerial (function) Timer (function)DateValue (function) TimeSerial (function)Day (function) TimeValue (function)Hour (function) Weekday (function)Minute (function) Year (function)

1.1.7 Display: DialogsAnswerBox (function) MsgBox (function)AskBox (function) MsgBox (statement)AskBox$ (function) OpenFilename$ (function)AskPassword (function) PopupMenu (function)AskPassword$ (function) SaveFilename$ (function)InputBox (function) SelectBox (function)InputBox$ (function)

1.1.8 Display: General ControlEchoClient.AddEchoData (method) DisplayDeviceEchoClient.Draw (method)DisplayDevice.CalcActualRefreshRate (method) Slide.Draw (method)DisplayDevice.CalculateRefreshRate (method) SlideState.Draw (method)DisplayDevice.Canvas (method) SlideVisualStim.Draw (method)Slide.Clear (method) StimDisplay.Draw (method)SlideState.Clear (method) GetDefaultDisplayDevice (function)SlideVisualStim.Clear (method) SlideState.HitTest (method)StimDisplay.Clear (method) ImageDisplay.Load (method)CPaletteIndex (function) SlideImage.Load (method)DisplayDevice.CreateCanvas (method) DisplayDevice.Open (method)DisplayDeviceEchoClientCollection.CreateEchoClient (method)

DisplayDevice.Palette (method)

SRBoxDeviceEchoClientCollection.CreateEchoClient (method)

DisplayDevice.RestoreVideoBuffers (method)

EchoClient.Detach (method) DisplayDevice.WaitForVerticalBlank (method)

1.1.9 Display: GraphicsCanvas.Arc (method) Canvas.MoveTo (method)Canvas.CalculateTextSize (method) Canvas.Oval (method)Canvas.Chord (method) Canvas.Pie (method)Canvas.Circle (method) PointInRect (function)Canvas.Clear (method) Canvas.Polygon (method)Canvas.Copy (method) Canvas.Rectangle (method)Palette.GetEntries (method) Canvas.RoundedRectangle (method)Canvas.GetPixel (method) Canvas.SaveImage (method)Canvas.Line (method) Palette.SetEntries (method)Canvas.LineTo (method) Canvas.SetPixel (method)Canvas.LoadImage (method) Canvas.Text (method)

Page 3

Page 4: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.10 Error HandlingErr.Clear (method) Err.HelpFile (property)Err.Description (property) Err.LastDLLError (property)Erl (function) Err.Number (property)Error (statement) On Error (statement)Error (function) Err.Raise (method)Error$ (function) Resume (statement)Err.HelpContext (property) Err.Source (property)

1.1.11 Experiment Control: PortsSerialDevice.FlushInputBuffer (method) ReadPort (function)SerialDevice.FlushOutputBuffer (method) SerialDevice.ReadString (method)SerialDevice.Open (method) IOPort.Write (method)SerialDevice.Peek (method) SerialDevice.WriteBytes (method)IOPort.Read (method) SerialDevice.WriteInteger (method)SerialDevice.ReadBytes (method) SerialDevice.WriteLong (method)SerialDevice.ReadInteger (method) WritePort (statement)SerialDevice.ReadLong (method) SerialDevice.WriteString (method)

1.1.12 Experiment Control: StimulusCellSpec.Add (method) Order.IsEmpty (method)Context.Add (method) Factor.Load (method)FactorSpace.AddAttrib (method) Context.Log (method)FactorTable.AddFactor (method) Context.LogHeader (method)Factor.AddLevel (method) Order.PeekAhead (method)Order.Advance (method) FactorSpace.PeekAttrib (method)Context.AttribExists (method) Context.PopFrame (method)Deletion.Count (method) Context.PushNewFrame (method)Order.Count (method) FactorSpace.Reset (method)Context.GetAttrib (method) RteRunnableObject.Run (method)Factor.GetAttrib (method) Context.SetAttrib (method)FactorSpace.GetAttrib (method) Factor.SetAttrib (method)FactorSpace.GetAttribLogFlag (method) Context.SetAttribAtSource (method)Context.GetAttribNames (method) FactorSpace.SetAttribLogFlag (method)Context.GetCellSpec (method) Context.SetLogLevelName (method)Order.GetCurrent (method) Factor.SetNested (method)FactorSpace.GetCurrentAttrib (method) FactorSpace.SetNested (method)Order.GetFactorSpace (method) Factor.SetProc (method)Context.GetLevel (method) FactorSpace.SetProc (method)Context.GetLevelName (method) Factor.SetWeight (method)Context.GetLogLevelName (method) FactorSpace.Size (method)Order.GetNext (method) FactorTable.Size (method)FactorSpace.GetNextAttrib (method) FactorSpace.Terminate (method)FactorSpace.GetPrevAttrib (method) LatinSquares.TotalRunsNeeded (method)Order.GetPrevious (method) LatinSquares.TotalSamplesNeeded (method)FactorSpace.GetProc (method) Context.Update (method)

1.1.13 Experiment Control: TimingGetNextTargetOnsetTime (function) Clock.ReadMillisec (method)GetOSThreadPriority (function) Clock.ResetScale (method)Clock.Read (method) SetNextTargetOnsetTime (statement)Clock.Read1000thMillisec (method) SetOSThreadPriority (statement)Clock.Read100thMillisec (method) SetPcodeSleepDuration (statement)Clock.Read10thMillisec (method) SetPcodeSleepFrequency (statement)Clock.ReadMicrosec (method)

Page 4

Page 5: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.14 File Input/OutputClose (statement) Lock (statement)Eof (function) Lof (function)FreeFile (function) Open (statement)Get (statement) Print # (statement)Input (function) Put (statement)Input# (statement) Reset (statement)Input$ (function) Seek (function)InputB (function) Seek (statement)InputB$ (function) Unlock (statement)Line Input # (statement) Width# (statement)Loc (function) Write# (statement)

1.1.15 Input Device ControlInputDevice.CreateInputMask (method) MouseResponseData.IsButton8 (method)SRBoxDevice.Flush (method) MouseDevice.IsCursorVisible (method)MouseDevice.GetCursorLimits (method) SRBoxDevice.KeyCount (method)MouseDevice.GetCursorPos (method) SRBoxDevice.Lamps (method)InputDevice.InsertResponse (method) KeyboardDevice.Open (method)MouseResponseData.IsButton1 (method) MouseDevice.Open (method)MouseResponseData.IsButton2 (method) PortDevice.Open (method)MouseResponseData.IsButton3 (method) SRBoxDevice.Open (method)MouseResponseData.IsButton4 (method) MouseDevice.SetCursorLimits (method)MouseResponseData.IsButton5 (method) MouseDevice.SetCursorPos (method)MouseResponseData.IsButton6 (method) MouseDevice.ShowCursor (method)MouseResponseData.IsButton7 (method)

1.1.16 MathAbs (function) Sgn (function)Atn (function) Sin (function)Cos (function) Sqr (function)Exp (function) Tan (function)Log (function)

1.1.17 Math: FinancialDDB (function) Pmt (function)FV (function) PPmt (function)IPmt (function) PV (function)IRR (function) Rate (function)MIRR (function) SLN (function)NPer (function) SYD (function)NPV (function)

1.1.18 Math: RandomizationPRNG.GetNext (method) Randomize (statement)PRNG.GetPrev (method) RandomizeArray (function)PRNG.GetSeed (method) PRNG.Reset (method)PRNG.Random (method) Rnd (function)Random (function) PRNG.SetSeed (method)Random (function) SetSeed (statement)Randomize (function)

Page 5

Page 6: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.19 Object ControlCreateObject (function) Is (operator)GetObject (function) Nothing (keyword)

1.1.20 Operators- (operator) > (operator)* (operator) >= (operator)/ (operator) And (operator)\ (operator) Eqv (operator)^ (operator) Imp (operator)+ (operator) Mod (operator)< (operator) Not (operator)<= (operator) Or (operator)<> (operator) Xor (operator)= (operator)

1.1.21 Program ControlRteCollection.Add (method) If...Then...Else (statement)Debug.Assert (method) IIf (function)Call (statement) InputMask.IsPending (method)Choose (function) InputMaskManager.IsPending (method)Device.Close (method) DeviceManager.IsSuspended (method)Declare (statement) Main (statement)Do...Loop (statement) Device.Open (method)DoEvents (function) Debug.Print (method)DoEvents (statement) RteCollection.Remove (method)End (statement) RteCollection.RemoveAll (method)Exit Do (statement) InputMaskManager.Reset (method)Exit For (statement) Device.Resume (method)Exit Function (statement) DeviceManager.Resume (method)Exit Sub (statement) Return (statement)For Each...Next (statement) Select...Case (statement)For...Next (statement) SetUserBreakState (statement)Function...End (statement) Sleep (statement)DeviceManager.GetDevice (method) Sleep (statement)DeviceManager.GetDeviceCount (method) Sub...End Sub (statement)Rte.GetObject (method) Device.Suspend (method)Rte.GetObjectCount (method) DeviceManager.Suspend (method)Device.GetState (method) Switch (statement)GetUserBreakState (function) InputMask.Terminate (method)GoSub (statement) InputMaskManager.Terminate (method)Goto (statement) While...Wend (statement)

Page 6

Page 7: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

1.1.22 String Manipulation& (operator) MidB (function)Format (function) MidB (statement)Format$ (function) MidB$ (function)InStr (function) MidB$ (statement)InStrB (function) Option Compare (statement)Item$ (function) Option CStrings (statement)ItemCount (function) Right (function)LCase (function) Right$ (function)LCase$ (function) RightB (function)Left (function) RightB$ (functions)Left$ (function) RSet (statement)LeftB (function) RTrim (function)LeftB$ (function) RTrim$ (function)Len (function) Space (function)LenB (function) Space$ (function)Like (function) StrComp (function)Line$ (function) StrConv (function)LineCount (function) String (function)LSet (function) String$ (function)LTrim (function) Trim (function)LTrim$ (function) Trim$ (function)Mid (function) UCase (function)Mid (statement) UCase$ (function)Mid$ (function) Word$ (function)Mid$ (statement) WordCount (function)

1.1.23 Variable Control= (statement) Global (statement)ArrayDims (function) IsEmpty (function)ArraySort (statement) IsError (function)Const (statement) IsMissing (function)DefBool (statement) IsNull (function)DefCur (statement) IsObject (function)DefDate (statement) LBound (function)DefDbl (statement) Let (statement)DefInt (statement) Option Base (statement)DefLng (statement) Private (statement)DefObj (statement) Public (statement)DefSng (statement) ReDim (statement)DefStr (statement) Set (statement)DefVar (statement) Type (statement)Dim (statement) UBound (function)Erase (statement) VarType (function)

Page 7

Page 8: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

CHAPTER 4 : USING E-BASIC __ ERROR: REFERENCE SOURCE NOT FOUND

4.1 Why Use E-Basic? _____________ Error: Reference source not found 4.1.1 Before Beginning… _____________________ Error: Reference source not found

4.1.2 Basic Steps ____________________________ Error: Reference source not found

4.2 Introducing E-Basic ___________ Error: Reference source not found 4.2.1 Syntax ________________________________ Error: Reference source not found

4.2.2 Getting Help ___________________________ Error: Reference source not found

4.2.3 Handling Errors in the Script ______________ Error: Reference source not found

4.3 Communicating with E-Prime Objects _ Error: Reference source not found

4.3.1 Context _______________________________ Error: Reference source not found

4.3.2 Object.Properties ________________________ Error: Reference source not found

4.3.3 Object.Methods _________________________ Error: Reference source not found

4.3.4 Variable Declaration and Initialization _______ Error: Reference source not found

4.3.5 User Script Window vs. InLine Object _______ Error: Reference source not found

4.4 Basic Steps for Writing E-Prime Script _ Error: Reference source not found

4.4.1 Determine the purpose and placement of the script __ Error: Reference source not found

4.4.2 Create an InLine object and enter the script ___ Error: Reference source not found

4.4.3 Determine the scope of variables and attributes _____ Error: Reference source not found

4.4.4 Set or reference values in script ____________ Error: Reference source not found

4.4.5 Reference script results from other objects ____ Error: Reference source not found

4.4.6 Debug ________________________________ Error: Reference source not found

4.4.7 Test __________________________________ Error: Reference source not found

4.5 Programming: Basic ___________ Error: Reference source not found 4.5.1 Logical Operators _______________________ Error: Reference source not found

Page 8

Page 9: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideChapter 2: E-Basic

4.5.2 Flow Control ___________________________ Error: Reference source not found

4.5.3 Examples and Exercises __________________ Error: Reference source not found

4.5.4 Additional Information ___________________ Error: Reference source not found

4.6 Programming: Intermediate ____ Error: Reference source not found 4.6.1 More on Variables _______________________ Error: Reference source not found

4.6.2 Writing Subroutines _____________________ Error: Reference source not found

4.6.3 Writing Functions _______________________ Error: Reference source not found

4.6.4 Additional Information ___________________ Error: Reference source not found

4.7 Programming: Advanced _______ Error: Reference source not found 4.7.1 Arrays ________________________________ Error: Reference source not found

4.7.2 Timing ________________________________ Error: Reference source not found

4.7.3 User-Defined Data Types _________________ Error: Reference source not found

4.7.4 Examples ______________________________ Error: Reference source not found 4.7.5 Additional Information Error: Reference source not found

Page 9

Page 10: Listing of E-Basic Commands - TalkBankstep.talkbank.org/materials/ppt/ebasic.doc · Web viewE-Basic is almost identical to Visual Basic for Applications, with additional commands

E-Prime Reference GuideE-Basic

This page intentionally left blank.