This article applies to:
E-Prime 2.0
Symptoms
The InLine script on page 75 of the E-Prime Getting Started Guide has script that contains errors.
Solution
The correct script is as follows:
'Create a Canvas
Dim cnvs As Canvas
Set cnvs = Display.Canvas
Dim XRes As Integer, YRes As Integer 'Previously used IntegerInteger for XRes
XRes = Display.XRes 'Previously included a hyphen between X and Res
YRes = Display.YRes
'Declare Variables and initialize
Const nRadius As Integer = 100 'Previously not initialized with a value as all constants must be
Dim nStartAngle As Integer, nEndAngle As Integer
Dim nCount as Integer
nStartAngle = 90
nEndAngle = 90
Dim nRandom As Integer
Dim nDelay As Integer
nRandom = Random (1,2)
If nRandom = 1 Then
nDelay = 500
Else
nDelay = 1000
End If
'Set colour of pen for pie slice
cnvs.PenColor = CColor("red")
cnvs.FillColor = CColor("red")
'Start Countdown
For nCount = 1 to 10
nStartAngle = nStartAngle -36
'Draw a pie slice with center point at x,y and radius r, starting
' at startAngle end drawing at to endAngle FillColor
cnvs.Pie XRes/2, YRes/2, nRadius, nStartAngle, nEndAngle
'Sleep before drawing next pie slice
Sleep ndelay
Next ncount
'Set fillcolor to white before clearing canvas
cnvs.FillColor = CColor ("white")
cnvs.Clear
'Set the value of the delay as an attribute in the data file
c.SetAttrib "Delay", nDelay * 10
'Print the value of the entire delay to the Output window
Debug.Print "Delay = " & nDelay
For more information view the E-Prime Command Reference for specifics involving E-Basic (https://pstnet.com/ecr).
Comments
0 comments
Please sign in to leave a comment.