Newbie questions about Pliant

Newbie questions about Pliant

Arrays

Acessing Arrays through database engine.
Message posted by maybe Willer Alves on 2001/04/27 20:23:53
Let's supose I write this line in the User type definion (user.pli)

field Array:Str friends

How can I write, read, and erase data in this array? I also want to use the original shortcut as the same way as user:user_name:name .
Message posted by pom on 2001/04/27 20:49:43
The simple way could be to declare a Set:Str :
field Set:Str friends
this way, you may use it the same way as users, like
each f user:user_name:friends
   console f " is a friend of " user_name
friends should have a key (could be the same as the name, or any single key Str), they are created and deleted using
user:user_name:friends create key; user:user_name:friends:key:=friends_name
user:user_name:firends delete key
you may also not use the value and only create and delete records without affecting any value (will be default). Then, the friend names may be accessed using
each f user:user_name:friends
   console keyof:f " is a friend of " user_name
Message posted by maybe Willer Alves on 2001/04/30 11:14:13
Thanks!!!