Thursday, March 03, 2005

Another use for JUSTEXT( )

Most developers see functions like JUSTFNAME ( ) and JUSTPATH) as file -based functions, useful for stripping down file names down to their lowest level. But they can also be used with tables and aliases.
 
Example:
 
CUSTOMERS.COMPANYNAME
 
? JUSTEXT("CUSTOMERS.COMPANYNAME")  && returns COMPANYNAME
? JUSTSTEM("CUSTOMERS.COMPANYNAME") && returns CUSTOMERS

(correction from comments: JUSTSTEM is the function I wanted, not JUSTFNAME which gives the full file name, doh! - thanks Sietse)
 
This can be a handy way of parsing through data dictionaries.

1 comment:

Sietse Wijnker said...

Erm....
I'm sure you ment
JUSTSTEM("CUSTOMERS.COMPANYNAME") for the 2nd line of code to return the alias?