Passing/Evaluating Strings as Executable Code

Jake jakey.anderson at gmail.com
Tue Jul 2 17:21:15 UTC 2013


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+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/bc1065ec-7dde-46ca-a30c-eff40694838e%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/20130702/a624933d/attachment.htm>


More information about the Eprime mailing list