Function: Header
Function: Header

Function: Header

Header ( KEY )

Returns the value of a module header field as a string value.

Parameters

Parameter Type Description
KEY VALUE(STRING) The name of the header key. Interpreted as string, even if it isn't.

Returns (one of the following)

VALUE(STRING) The corresponding value for the key.
VALUE(BOOLEAN) FALSE, if no corresponding key.

What It Does

This fetches the value of a module header as a string, or FALSE if the provided key does not have a corresponding value.

Example

Header Example


module
{
	title = "The Header Example";
	author = "Matt Tropiano";
	email = "mtropiano@emailsite.com";
}

world
{
	start()
	{
		textln("This module's name is: "+header("title"));
		textln("It was made by: "+header("author"));
		textln("The author's E-mail is: "+header("email"));
		quit;
	}
}

Additional Technical Notes

This function is mostly for debugging purposes. It may be a bad idea to make decisions based on the values that this function may return.

Headers are stored as strings in the module no matter how they are declared in TAMEScript. They must be parsed into a different type if they need to be something other than a string.

×

Modal Header