Creating a list from variable values…

MEDState Notation Repository Forums Coding Help Archive Creating a list from variable values…

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13122
    Med_Support
    Moderator
    Dena Carbonari

    I’m working on a delayed alternation program that has 4 delays that are defined in a list:
    LIST U = 0, 5, 10, 20
    When it’s time for the program to present a delay, it selects a value from the list randomly without replacement:
    RANDD T(113) = U

    This works fine, but here’s my question…

    We’d like to make it so that the user can define the 4 delays at the start of the session (using Var_Alias). If we have one variable for each delay value, how would I go about transferring that into a list?

    Thanks for your help!

    -Dena-

    #13123
    Med_Support
    Moderator
    Gary Bamberger

    You just need to specify the specific array elements when using the Var_Alias command:

    Var_Alias Delay 1 = U(0)
    Var_Alias Delay 2 = U(1)
    Var_Alias Delay 3 = U(2)
    Var_Alias Delay 4 = U(3)
    
     
    
    LIST U = 0, 5, 10, 20
    
     
    
    S.S.1,
    S1,
    #START: RANDD T(113) = U ---> S2
    
    #13126
    Med_Support
    Moderator
    Dena Carbonari

    Thanks, Gary!

    -Dena-

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.