Forum archive 2000-2006

Michael Gage - TEXT

Michael Gage - TEXT

by Arnold Pizer -
Number of replies: 0
inactiveTopicTEXT topic started 12/15/2001; 12:20:28 PM
last post 12/15/2001; 12:20:28 PM
userMichael Gage - TEXT  blueArrow
12/15/2001; 12:20:28 PM (reads: 1703, responses: 0)

TEXT

Description
The HEADER_TEXT() function is the basic print mechanism for PG problems. It concatenates its arguments and places them in the output text string for inclusion in the body of an HTML document. It can be used more than once in a PG source file.

Syntax

TEXT($string1, $string2...);

Params

A list of strings.

Action

Places its concatenated input in $STRINGforOUTPUT

Returns

Nothing

Examples

A barebones PG problem using TEXT:

DOCUMENT();
loadMacros(PGbasicmacros.pl,
PGanswermacros.pl );

TEXT(beginproblem());
TEXT( "Hello", ans_rule() , ".");
ANS(str_cmp("World") );
ENDDOCUMENT();

Notes

TEXT() is mainly used in constructing more abstract macros, however it can also be useful for directly including strings into the body of the HTML without any processing. For example, TEXT(beginproblem()); is often placed near the top of a PG problem source file in order to include "beginproblem"()'s output text, which indicates the number of the problem and the number of points it is worth.

See Also

"BEGIN_TEXT/END_TEXT", HEADER_TEXT

Macro Definition File

PG.pl

 

<| Post or View Comments |>