nested listst

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Van den Houten Willy

    #1

    nested listst

    Hello,

    Can anyone help me to get this code up and running ?
    It's a task about nested lists, and I don't understand it.

    Module Client
    Sub Main()
    Dim myProcess1 As New Process("proces s1")
    PrintProcessDat a(myProcess1)

    Dim myTask1 As New Task("task1")
    myProcess1.AddT ask(myTask1)
    PrintProcessDat a(myProcess1)

    myProcess1.AddT ask(New Task("task2"))
    PrintProcessDat a(myProcess1)

    myProcess1.AddT ask(New Task("task3"))
    PrintProcessDat a(myProcess1)

    Dim myProcess2 As New Process("proces s2")
    myProcess2.AddT asks(New Task() {New Task("task4"), myTask1, New
    Task("task5")})
    PrintProcessDat a(myProcess2)

    myTask1.Name = "task1b"
    PrintProcessDat a(myProcess1)
    PrintProcessDat a(myProcess2)

    myProcess2.AddT asks(myProcess1 )
    PrintProcessDat a(myProcess2)

    Console.ReadLin e()
    End Sub
    Sub PrintProcessDat a(ByVal process As Process)
    Console.WriteLi ne("PROCESS: " & process.Name)
    Console.WriteLi ne("INHOUD:")
    Console.WriteLi ne(process.ToSt ring())
    Console.WriteLi ne("AANTAL-ELEMENTEN: " & process.Count() )
    Dim firstTask As Task = process.FirstTa sk()
    If Not firstTask Is Nothing Then
    Console.WriteLi ne("FIRST-TASK: " & process.FirstTa sk().Name)
    Else
    Console.WriteLi ne("FIRST-TASK: -")
    End If
    Dim lastTask As Task = process.LastTas k()
    If Not lastTask Is Nothing Then
    Console.WriteLi ne("LAST-TASK: " & process.LastTas k().Name)
    Else
    Console.WriteLi ne("LAST-TASK: -")
    End If

    Console.WriteLi ne("*********** *************** *************** *************** *************** *********")
    End Sub
    End Module



  • Cor Ligthert

    #2
    Re: nested listst

    Willy,

    A strange question, why do you ask this, do you want to use it for some
    reason or did you find it on internet and it does not run?

    Cor


    Comment

    • Van den Houten Willy

      #3
      Re: nested listst

      Hi Cor,

      It's a task for school, but I don't understand it...
      I think this shouldn't be a task...

      Thanks

      Willy

      "Cor Ligthert" wrote:
      [color=blue]
      > Willy,
      >
      > A strange question, why do you ask this, do you want to use it for some
      > reason or did you find it on internet and it does not run?
      >
      > Cor
      >
      >
      >[/color]

      Comment

      Working...