Re: how to convert variable name to a string?



On Jul 12, 8:08 am, cowbee <weihuang1...@xxxxxxxxx> wrote:
dudes,
I could not find a way to convert a variable name to a string, or
convert a string to a variable name
e.g, character *100 x
real VAR1
x = "VAR1", how to use x to manipulate the VAR1?

best
Wei

I don't understand what you want to do.
If you want to convert the current value of a variable into a
chatacter string then you use the internal write command
WRITE(X,'format specifier') VAR1
where the format specifier is probably in the form Fw.d .

If it is the variable name itself you require as a string then
X='VAR1'
will form a 100 character length string with VAR1 as the first four
characters.





If you want to supply the contents
.



Relevant Pages

  • [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
    ... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ...
    (Linux-Kernel)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)
  • Re: RfD: Escaped Strings
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... \b BS (backspace, ASCII 8) ... \ ** escapes to characters much as C does. ...
    (comp.lang.forth)
  • Re: A note on computing thugs and coding bums
    ... code is valid for any character set that is legal in C (which is a ... characters in the required source character set ... A String, in C Sharp or Java, can be redefined. ... allow programmers to handle some other data format, ...
    (comp.programming)