[EMAIL PROTECTED] wrote:

>  names: load %names.r
> == [Francois_Prowse [
>         workemail [EMAIL PROTECTED]
>         homeemail [EMAIL PROTECTED]
>         title "engineer"
>     ]
>     Bill...
>

> If would be good if I could do the following but having trouble.
>
> foreach person names [print person/workemail]

it should be trivial, you just created two record containing two fields in
regard to main block - person and personal-info, so just use it :-)

foreach [person personal-info] names [
          print person
          print personal-info/workemail
]

Does it help?

Regards,

-pekr-

>
> Cheers
>
> Francois
>
> file begins...
> --------------
> [
> Francois_Prowse
>
>         workemail [EMAIL PROTECTED]
>         homeemail [EMAIL PROTECTED]
>         title "engineer"
>                 ]
> ]
>
> [
> Bill_Smith      [
>         workemail [EMAIL PROTECTED]
>         homeemail [EMAIL PROTECTED]
>         title "cleaner"
>                 ]
> ]
> [
> Alyson_King     [
>         workemail [EMAIL PROTECTED]
>         homeemail none
>         title "manager"
>                 ]
> ]
>
> > Hi :-)
> >
> > 1) first, I would change your block to:
> >
> > Names: [
> >  Bill_Smith  [
> >         workemail [EMAIL PROTECTED]
> >         homeemail [EMAIL PROTECTED]
> >         title "Engineer"
> >   ]
> > ]
> >
> > If you want to use path navigation, for e.g.
> >
> > info: names/Bill_Smith
> >
> > Now you are able to navigate even further:
> >
> > names/Bill_Smith/workemail
> > == [EMAIL PROTECTED]
> >
> > But sadly, I don't know how to substitute Bill_Smith value with some
> > referencing variable ...
>
> Hi Pekr and Francios,
>
> Here's a way to do that....
>
> name: to-word "Bill_Smith"
>
> == Bill_Smith
> >> name/:search
> == [
>     workemail [EMAIL PROTECTED]
>     homeemail [EMAIL PROTECTED]
>     title "Engineer"
> ]
>
> works for further levels down too
> name: to-word "Bill_Smith"
> entry: to-word "title"
>
> >> names/:name/:entry
> == "Engineer"
>
> Cheers,
>
> Allen K

Reply via email to