Page 1 of 1

Passing Str. Linked list to procedure.

Posted: Sat Feb 06, 2010 7:13 pm
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

Re: Passing Str. Linked list to procedure.

Posted: Sat Feb 06, 2010 7:14 pm
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

Re: Passing Str. Linked list to procedure.

Posted: Sat Feb 06, 2010 7:18 pm
by Grimmjow
Oh i see :D Thank you very much !