| Profil de Windows Live Ag...Windows Live AgentsPhotosBlogListes | Aide |
|
25 avril BuddyScript SubpatternsSubpatterns are much like functions in that they can be used as filters for data -- one value is passed in, evaluated, and another possibly different value is returned. That's why we can do things like this:
Let's look at a slightly different kind of subpattern.
The Dessert subpattern above is a BuddyScript subpattern -- a subpattern that returns its match score based on some logic defined within it. VALUE is a special variable made available for this kind of subpattern and contains the token being evaluated -- here it is passed to the DessertIsOnMenu function, which returns true if the parameter it receives exists as a key in the G_DESSERTS object. If this is the case, the token will match to Dessert with a score of 100.
Using BuddyScript subpatterns enables scenarios in which you can match in a dynamic way, tightly controlling how matches are evaluated and scored. Commentaires (19)Pour ajouter un commentaire, connectez-vous avec votre identifiant Windows Live ID (si vous utilisez Messenger ou Xbox LIVE, vous avez un identifiant Windows Live ID). Connectez-vous Vous n'avez pas d'identifiant Windows Live ID ? Inscrivez-vous
RétroliensL'URL de rétrolien de ce billet est : http://windowsliveagents.spaces.live.com/blog/cns!5BCD45E519E07634!539.trak Blogs Web qui font référence à ce billet
|
|
|