locked
Need translation from C# to VB LightSwitch... RRS feed

  • Question

  • Would someone please help me with translating the bold face C# line below to VB LightSwitch

    Dim task = MilestoneTasks.SelectedItem    

    If task Is Nothing Then              
        Return           
    End If         

        Need this C# line translated to VB LightSwitch...
        'var index = Tasks.TakeWhile(t => t != task).Count()     

        I tried this translation but LightSwitch doesn't like it...
        'Dim index = MilestoneTasks.TakeWhile(Function(t) t <> task).Count()      Doesn't like operator '<>'        

        I tried this translation but LightSwitch doesn't like it...
        'Dim index = MilestoneTasks.TakeWhile(Function(t) t Is Not task).Count()  Doesn't like operator 'Is Not'             

    If index <= 0 Then            
        Return        
    End If

    Thank you,
    Edward


    Edward Piccoli

    Friday, January 3, 2014 2:39 AM

Answers

  • Hi t refers to a Collection. Use t.id <> task.id).Count instead.

    Regards

    Sven


    Sven Elm

    • Marked as answer by Angie Xu Monday, February 10, 2014 1:08 AM
    Friday, January 3, 2014 9:38 AM