[rkward-cvs] SF.net SVN: rkward: [1683] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Mar 21 16:44:07 UTC 2007


Revision: 1683
          http://svn.sourceforge.net/rkward/?rev=1683&view=rev
Author:   tfry
Date:     2007-03-21 09:44:06 -0700 (Wed, 21 Mar 2007)

Log Message:
-----------
Add convenience function to print something with indentation

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php
    trunk/rkward/rkward/scriptbackends/common.php

Modified: trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php	2007-03-21 16:43:39 UTC (rev 1682)
+++ trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php	2007-03-21 16:44:06 UTC (rev 1683)
@@ -55,12 +55,15 @@
 rk.graph.on ()
 <? }
 ?>
-try (curve (<? echo ($fun); ?> (x, shape1 = <? echo ($a); ?>, shape2 = <? echo ($b); ?>, ncp = <? echo ($ncp); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>))
-<?	if (!empty ($plot_adds)) {
-		echo ("\n\t" . strtr ($plot_adds, array ("\n" => "\n\t")));
-	}
+try ({
+	curve (<? echo ($fun); ?> (x, shape1 = <? echo ($a); ?>, shape2 = <? echo ($b); ?>, ncp = <? echo ($ncp); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>)
+<?	if (!empty ($plot_adds)) { ?>
 
-	if ($final) { ?>
+<?
+		printIndented ("\t", $plot_adds);
+	} ?>
+})
+<?	if ($final) { ?>
 rk.graph.off ()
 <? }
 }

Modified: trunk/rkward/rkward/scriptbackends/common.php
===================================================================
--- trunk/rkward/rkward/scriptbackends/common.php	2007-03-21 16:43:39 UTC (rev 1682)
+++ trunk/rkward/rkward/scriptbackends/common.php	2007-03-21 16:44:06 UTC (rev 1683)
@@ -1,4 +1,9 @@
 <?
+function printIndented ($indentation, $lines) {
+	$out = ereg_replace ("\n.", "\\1\n" . $indentation, $lines);
+	echo ($indentation . $out);
+}
+
 // rename to getRK
 function getRK_val ($id) {
 	return (getInput ("requesting data:" . $id));


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list