String Methods

The String module provides some useful methods for String class objects.

 

getSymbol()

This method returns the symbol from the global symbols table associated with this string key. If this string is not a key in the global symbols table, then nil is returned.

 

getPredicate()

This method returns the static predicate object associated with tag that this string represents. The tag is the one used by the VerbRule(tag) macro to define a predicate. For instance ‘Take’.getPredicate() would return the predicate object that has the tag Take. If the string doesn’t have a corresponding predicate then the method returns nil.

 

getVerbPhrase()

This method returns the single-quoted string verbPhrase property of the predicate associated with the tag that this string represents. If there is no predicate associated with this string, the method returns nil.

 

getCmdHref([strings])

This method returns the command href associated with the tag that this string represents. If there’s no predicate associated with this string, the method returns nil. The strings variable argument list should contain the list of strings to be substituted for the verbPhrase’s ‘(what)’ or ‘(whom)’ portions.

 

An example follows:

 

       ‘ZtreeDefinerObj’.getCmdHref(‘followingActor’)

 

would return the href

 

       ‘ztree definer followingActor’

 

 

 

This file is part of the TADS 3 Proteus Library Extension

Copyright © 2001-2004 Kevin Forchione. All rights reserved.