Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Passing the subject and/or condition ID to an Executable

  1. #1
    jarvis24 Blair Jarvis, Administrator

    Passing the subject and/or condition ID to an Executable

    [edited from support email]
    I am currently working on a little program that serves special needs we could not address using Medialab or Direct Rt (or any other research software we ever used). This little program is supposed to be integrated into a larger experiment, controlled by Medialab. There will be ML/DRT parts before our program and there will be ML/DRT parts afterwards. Hence, ML will be programmed in such a way that it will call our program, which will come as a Windows executable.

    Here’s my question: Is there a way do pass the Subject ID from ML to our program? This would be most convenient, as research assistants would have to enter the Subject ID only once. Our program will be written in Visual Basic 6.

  2. #2
    jarvis24 Blair Jarvis, Administrator
    Yes there is. The subject and condition info is contained in a text file called "currentsubjectinfo.txt" as soon as the session begins. Here is some VB code that would allow your VB6 program to access it during the session:
    Open "c:\medialab\currentsubjectinfo.txt" For Input As #1
    Input #1, subject: subject = Mid(subject, 11, Len(subject) - 10)
    Input #1, condition: condition = Mid(condition, 11, Len(condition) - 10)
    Close #1