11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

System and Other FunctionslangAn integer code specifying the language mode to use for validation. <strong>Caché</strong> applies the conventionsof the specified language mode to the validation without changing the current languagemode. The default is for $ZNAME to use the language mode conventions of the currentlanguage mode. To determine or to change the current language mode, and for a list ofavailable language mode, see the $ZUTIL(55) function.ExamplesThe following example shows the $ZNAME function validating the expressions as true (1).The last example succeeds because with n = 1, $ZNAME performs validation for routinenames; routine names can have a percent sign as any character of the name.WRITE !,$ZNAME("A")WRITE !,$ZNAME("A1")WRITE !,$ZNAME("%A1",0)WRITE !,$ZNAME("%A1",1)WRITE !,$ZNAME("A%1",1)The following example fails validation (returns 0) because the first character of a local variablename cannot be a digit.WRITE $ZNAME("1A")The following example fails validation because with n = 0, $ZNAME performs a local variablename validation; such names cannot contain a percent sign unless it is the first character ofthe name:WRITE $ZNAME("A%1",0)The following example shows the full set of valid identifier characters for local variablenames. These valid identifier characters include the letter characters ASCII 192 throughASCII 255 (with the exceptions of ASCII 215 and ASCII 247, which are arithmetic symbols):FOR n=1:1:500 {IF $ZNAME("A"_$CHAR(n),0) & $ZNAME($CHAR(n),0){WRITE !,$ZNAME($CHAR(n))," ASCII code=",n," Char.=",$CHAR(n) }ELSEIF $ZNAME($CHAR(n),0){WRITE !,$ZNAME($CHAR(n))," ASCII code=",n," 1st Char.=",$CHAR(n) }ELSEIF $ZNAME("A"_$CHAR(n),0){WRITE !,$ZNAME("A"_$CHAR(n))," ASCII code=",n," Subseq. Char.=",$CHAR(n) }ELSE { }}WRITE !,"All done"NotesNot all legal identifiers may be used for global variable names; wide characters cannot beused in global variable names.550 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!