summaryrefslogtreecommitdiff
path: root/macros/ASTManagement/%variable_string.sci
diff options
context:
space:
mode:
authorjofret2009-05-05 13:52:15 +0000
committerjofret2009-05-05 13:52:15 +0000
commit83c68889eff40411bbef50df0904f3585ed9e2b7 (patch)
tree16fb9d67c603e867e10f675a6e5fb8c3bb58b41f /macros/ASTManagement/%variable_string.sci
parentb11350b841069ef8db155516a310eb7523c5e183 (diff)
downloadscilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.tar.gz
scilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.tar.bz2
scilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.zip
Split into several files
Diffstat (limited to 'macros/ASTManagement/%variable_string.sci')
-rw-r--r--macros/ASTManagement/%variable_string.sci23
1 files changed, 23 insertions, 0 deletions
diff --git a/macros/ASTManagement/%variable_string.sci b/macros/ASTManagement/%variable_string.sci
new file mode 100644
index 00000000..cfb2e8ec
--- /dev/null
+++ b/macros/ASTManagement/%variable_string.sci
@@ -0,0 +1,23 @@
+function txt=%variable_string(v)
+ global anscounter; //NUT: just to fix problem with ans variables.
+//overloading function for "variable" type tlist string function
+//fields: name
+//this is a leaf of the AST
+//NUT: changed here. For me %i is a number not a variable.
+ if (v.name == "%T" | ...
+ v.name == "%F"| ...
+ v.name == "%nan"| ...
+ v.name == "%inf"| ...
+ v.name == "%pi")
+ txt=['Number_x: '+v.name];
+ elseif (v.name == "%i")
+ txt=['Number_X: '+v.name];
+ else
+ if (v.name == 'ans')
+ anscounter = anscounter + 1;
+ txt=['Variable: '+v.name+string(anscounter)];
+ else
+ txt=['Variable: '+v.name];
+ end
+ end
+endfunction \ No newline at end of file