Passing/Evaluating Strings as Executable Code

Jake jakey.anderson at gmail.com
Fri Jul 5 16:28:51 UTC 2013


Paul & David,
Thanks for your thoughts and suggestions,

Paul, that's a great suggestion, in fact, I delivered a palm to my forehead 
when I read your note.  

Cheers,
Jake


On Wednesday, July 3, 2013 3:32:21 PM UTC-5, Paul Groot wrote:
>
> Hi Jake,
>
> I think you are looking for a solution that is more complex than actually 
> required. Instead of changing an object property indirectly by changing an 
> attribute value, why not changing the object property directly?
>
> This is a piece of code that I used in my VAS script to highlight a 
> selected button:
>
>         Set hitObject = CSlideText(ACK_SlideState.Objects(strHit))
>         hitObject.BackColor = CColor("silver")
>         hitObject.Draw
>         etc...
>
>
> Best
> Paul
>
>
>
> On 3 July 2013 18:07, David McFarlane <mcfa... at msu.edu <javascript:>>wrote:
>
>> Jake,
>>
>> I am fairly certain that E-Basic/VBA does not have anything like an 
>> eval() function.
>>
>> -----
>> David McFarlane
>> E-Prime training online:  http://psychology.msu.edu/**
>> Workshops_Courses/eprime.aspx<http://psychology.msu.edu/Workshops_Courses/eprime.aspx>
>> Twitter:  @EPrimeMaster (https://twitter.com/**EPrimeMaster<https://twitter.com/EPrimeMaster>
>> )
>>
>>
>> At 7/2/2013 01:21 PM Tuesday, Jake wrote:
>>
>>> Oh, I see why that's not working now, the logic was overwriting the 
>>> Attribute.
>>>
>>> Still, it would be good to know if you pass a string as an expression. 
>>>  I've search the documentation and some VB stuff online, but I haven't seen 
>>> an eval() like function. Has anyone else used/seen something like that in 
>>> E-Basic?
>>>
>>> Thanks,
>>> Jake
>>>
>>>
>>> On Tuesday, July 2, 2013 10:32:22 AM UTC-5, Jake wrote:
>>>  Dear Group,
>>> I'm trying to streamline some of my inline code in a Touch Screen task. 
>>> Is it possible to pass string values as execuatable pieces of code in 
>>> E-Basic? I can do this in MATLAB (I think) and R using and eval() function, 
>>> but is there an analogue in E-Basic?
>>>
>>> I've tried the following 'for' loop to assign an object border width 
>>> using the string returned from the HitTest function (Objects are named "R0" 
>>> through "R7"). I can compile the script fine, but it won't actually change 
>>> the attribute value for some reason. Perhaps I just need a second set of 
>>> eyes to point something out.  Any suggestions would be welcomed! Thanks, 
>>> Jake
>>>
>>> Set MouseResp = CMouseResponseData(Question.**InputMasks.Responses(1))
>>>  Hit = theState.HitTest(MouseResp.**CursorX, MouseResp.CursorY)
>>>  Dim i as Integer
>>>  Dim theBorder As String
>>>  For i = 0 To 7
>>>     theBorder = Hit & "BW"
>>>     If i = CInt(Mid(Hit,2,1)) Then
>>>       c.SetAttrib theBorder,"5"
>>>     Else
>>>       c.SetAttrib theBorder,"0"
>>>     End If
>>>  Next
>>>
>>>
>>> --
>>> ***************************************************
>>> Jacob E. Anderson, MA
>>> Scientist @ The Zelazo Lab
>>> Institute of Child Development
>>> 51 East River Rd.
>>> Minneapolis, MN 55455
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "E-Prime" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to e-prime+u...@**googlegroups.com <javascript:>.
>> To post to this group, send email to e-p... at googlegroups.com<javascript:>
>> .
>> To view this discussion on the web visit https://groups.google.com/d/**
>> msgid/e-prime/51d44c69.**472c320a.5826.6445SMTPIN_**
>> ADDED_MISSING%40gmr-mx.google.**com<https://groups.google.com/d/msgid/e-prime/51d44c69.472c320a.5826.6445SMTPIN_ADDED_MISSING%40gmr-mx.google.com>
>> .
>> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>> .
>>
>>
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/3ade0f8e-6d29-4b53-be09-1af80d0cdb6c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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


More information about the Eprime mailing list