AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YDAT | YWAIT | Byzgraf | FAQs
defined (String name [, Object target]) reserved
defined (int index, Object target)  
 
Looks for an existing definition, either in the current scope or in target, and returns 1 if the lookup succeeds and 0 otherwise. A single argument asks defined to look through the current block and all enclosing blocks for a definition of variable name. Two arguments asks whether the object at index in target is defined, or whether target contains a definition of name.
 
 Example:   The program,
import yoix.stdio.*;

if (defined("ptr")) {
    if (defined("total", ptr))
        printf("ptr.total=%d\n", ptr.total);
    else printf("ptr.total is not defined\n");
} else printf("ptr is not defined\n");
shows how you can find out if ptr.total exists, and if so print its value.
 
 Return:   int

 

Yoix is a registered trademark of AT&T Intellectual Property.