Executing a string related to source code, not the command line
From: Arun (arun_hallan_at_hotmail.com)
Date: 12/30/04
- Next message: ByteCoder: "Re: help on threads/monitor needed"
- Previous message: ByteCoder: "Re: field name for jOptionPane when using Eclipse?"
- Next in thread: Arun: "Re: Executing a string related to source code, not the command line"
- Reply: Arun: "Re: Executing a string related to source code, not the command line"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Dec 2004 11:59:15 -0800
How can i execute a string, for example:
int x = 2;
int y = 4;
int z;
String command = " z = x*y "
For some background on why i want to do this:
I have an element tree.
To add a certain element, i need to use the following command:
element.getChild("bla").setContent(newElement);
Problem is that the number of .getChild() corresponds to the element
depth in the tree.
So if its depth was two, then the command would be:
element.getChild("bla's dad").getChild("bla").setContent(newElement);
I can't do a for loop and then with every iteration get the child from
the previous child, because when i add an element i won't be adding it
to the whole element tree, il just be adding it to the previous
element.
I could build the whole tree again but that seems wasteful.
- Next message: ByteCoder: "Re: help on threads/monitor needed"
- Previous message: ByteCoder: "Re: field name for jOptionPane when using Eclipse?"
- Next in thread: Arun: "Re: Executing a string related to source code, not the command line"
- Reply: Arun: "Re: Executing a string related to source code, not the command line"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|