[system] / trunk / pg / macros / PGinfo.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/PGinfo.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4997 - (download) (as text) (annotate)
Mon Jun 11 18:16:40 2007 UTC (12 years, 7 months ago) by gage
File size: 2120 byte(s)
Fixing docementation so that it can be read from the web.

    1 
    2 ####################################################################
    3 # Copyright @ 1995-2007 University of Rochester
    4 # All Rights Reserved
    5 ####################################################################
    6 
    7 =head1 NAME
    8 
    9   PGinfo.pl
   10 
   11 Provides macros for determining the values of the current context in which the problem
   12 is being written.
   13 
   14 loadMacros("Parser.pl");
   15 
   16 =head3  listVariables
   17 
   18 Usage:  listVariables();
   19 
   20 Prints all variables submitted in the problem form and all variables in the
   21 the Problem environment and all of the flag variables in Context().
   22 This is used for debugging and to determine the current
   23 context for the problem.
   24 
   25 =cut
   26 
   27 
   28 sub listVariables {
   29   TEXT($HR,"Form variables",$BR );
   30   listFormVariables();
   31   TEXT($HR,"Environment variables",$BR );
   32   listEnvironmentVariables();
   33   TEXT($HR,"Context flags",$BR );
   34   listContextFlags();
   35 }
   36 
   37 =head4 listFormVariables()
   38 
   39   Called by listVariables to print out the input form variables.
   40 
   41 =cut
   42 
   43 sub listFormVariables {
   44     # Lists all of the variables filled out on the input form
   45   # Useful for debugging
   46     TEXT(pretty_print($inputs_ref));
   47 
   48 }
   49 
   50 =head4 listEnvironmentVariables()
   51 
   52   Called by listVariables to print out the environment variables (in %envir).
   53 
   54 =cut
   55 
   56 
   57 sub listEnvironmentVariables {
   58     # list the environment variables
   59     TEXT(pretty_print(\%envir));
   60 }
   61 
   62 =head4 listContextFlags()
   63 
   64   Called by listVariables to print out context flags for Math Objects.
   65 
   66 =cut
   67 
   68 sub listContextFlags {
   69   my $context = $$Value::context->{flags};
   70   TEXT(pretty_print($context));
   71 }
   72 
   73 =head3 listContext()
   74 
   75   Usage:  listContext(Context())
   76 
   77   Prints out the contents of the current context hash -- includes flags and much more
   78 
   79 =cut
   80 
   81 sub listContext {  # include
   82   my $context = shift;
   83   return TEXT("$PAR Error in listContext:  usage:  listContext(Context()); # must specify a context to list $BR") unless defined $context;
   84   foreach $key (keys %$context) {
   85     next if $key =~/^_/; # skip if it begins with _
   86     TEXT($HR, $key, $BR);
   87     TEXT( pretty_print($context->{$key}) );
   88   }
   89 }
   90 sub pp {
   91     my $hash = shift;
   92     "printing |". ref($hash)."|$BR". pretty_print($hash);
   93 }

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9