See the "Mid", "Context.GetAttrib", and "Context.SetAttrib" topics in
the E-Basic Help facility.
As for "brackets vs. quotes"... Well, this gets indirectly to a pet
peeve of mine. You see, rational programming languages (such as C)
use the same sytax for "subroutines" and "functions", and the best
languages eliminate that distinction altogether (e.g., in C
everything is a function -- "subroutines" are nothing more than
functions that return void). Alas, VBA (and thus E-Basic) makes a
hard distinction between these two concepts. This includes different
syntax. The arguments to VBA Functions *must* be enclosed in
parentheses (), while the arguments to VBA Subroutines must *not* be
enclosed in parentheses! Sheesh! And if you fail to do that, then
you will get an error message that is entirely unrelated to the
syntax error! I cannot tell you how many hours I have lost in
debugging errors due to this absurd difference in syntax.
Anyway, if you are unsure how to use E-Prime, then you should first
follow my advice in these two essays:
http://groups.google.com/group/e-prime/browse_thread/thread/5425e03968cab428
http://groups.google.com/group/e-prime/browse_thread/thread/b0ce54870b723fc3
It would also not hurt if you took a course specific to E-Prime,
e.g.,
http://psychology.msu.edu/Workshops_Courses/eprime.aspx .
In short, as in any serious enterprise, you need to first take time
out to get proper training, and that means including training time in
projected deadlines.
-- David McFarlane
At 5/22/2012 09:49 AM Tuesday, Beckerlab wrote:
>Hey David,
>
>I understand the code (I think), up until here:
>
> If Mid(strHit, 1, 5) = "Check" Then
>
> Dim nCheck As Integer
> nCheck = CInt(Mid(strHit, 6, 1))
>
> Debug.Print nCheck
>
> If c.GetAttrib("Check" & nCheck & "Image") =
> "checkempty.bmp" Then
>
> c.SetAttrib "Check" & nCheck & "Image",
> "checkfull.bmp"
>
>I don't know what the numbers 5,1 and 6,1 refer to...or why GetAttrib
>and SetAttrib have a different syntax (brackets vs. quotes?)...or what
>they do. I think it's if you click on one, the other image will show,
>but I am not sure of the logistics... I am also not sure how I would
>modify for my case. I need it so it's not a single image, but all of
>the images in the attribute that change if clicked. How do I reference
>attributes like this? Attributename.Triallist?
>
>My deadline is approaching and I am still quite unsure of how to use E-
>prime...I am also not new to programming, so I am very frustrated...
>
>Thanks for any help in advance.