AnsweredAssumed Answered

Text Variables Not Testing Equal

Question asked by builder on Jul 26, 2009
Latest reply on Jul 27, 2009 by builder


Text Variables Not Testing Equal



   I am putting the finishing touches on a Band and Orchestra student tracking solution and I am currently going through all the things I "settled" for and trying to make them the way they should work. Anyway, I have a script that basically takes a students name and concats it with the current date and places it in a field called userHistory when a school instrument is assigned to a student. If another student is assigned the same instrument it adds the user name to the userHistory and separates them with a carriage return. 

   I tried to modify the script to test if the students name is already there (if you clicking in the field and out again in runs the script again).

In the Script Debugger, both variable are the name but it doesn't test positive.  Here is the script.

 Freeze Window

Allow User Abort [Off] 

 if [IsEmpty (Inventory::studentUse)]

     Exit Script[]


    Set Variable [$name; Value:Student Info::fullName & " " & Get (CurrentDate)] 

    Set Variable [$i; Value:1]


        If [$name = MiddleValues ( Inventory::userHistory ; $i ; 1)] // Debugger shows these two as being equal

            Exit Script[] 

        End if 

        Set Variable [$i; Value:$i+1]

        Exit Loop If  [MiddleValues ( Inventory::userHistory ; $i ; 1) = ""]

    End Loop

    Replace Field Contents [No dialog; Inventory::userHistory; $name & "¶" & Inventory::userHistory]

End If 



Thanks for any help you can offer