Passing Str. Linked list to procedure.

Just starting out? Need help? Post your questions and find answers here.
Grimmjow
New User
New User
Posts: 8
Joined: Mon Jan 04, 2010 1:28 am

Passing Str. Linked list to procedure.

Post by Grimmjow »

Hey there.
I am still rare new to PB so i got one problem with structured linked list.
How can i pass it to procedure ? Here is my code but it dont work.
"Syntax Error". Can someone help me out ?^^

Code: Select all

Structure FILE
  Path.s
  Hash.s
EndStructure

NewList files.FILE()

Procedure AddFile(myList.FILE(), Path.s, Hash.s)
  AddElement(myList())
  myList()\Path = Path
  myList()\Hash = Hash
EndProcedure

AddFile(files(), "C:\System", "HASH")

ForEach files()
  Debug files()
Next

End
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Passing Str. Linked list to procedure.

Post by Trond »

Code: Select all

Structure FILE
  Path.s
  Hash.s
EndStructure

NewList files.FILE()

; Use "List" before list parameters and "Array" before array parameters
Procedure AddFile(List myList.FILE(), Path.s, Hash.s)
  AddElement(myList())
  myList()\Path = Path
  myList()\Hash = Hash
EndProcedure

AddFile(files(), "C:\System", "HASH")

ForEach files()
  Debug files()
Next

End
Grimmjow
New User
New User
Posts: 8
Joined: Mon Jan 04, 2010 1:28 am

Re: Passing Str. Linked list to procedure.

Post by Grimmjow »

Oh i see :D Thank you very much !
Post Reply