Re: converting program variables to arrays
- From: Martin Gregorie <martin@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 12:59:13 +0000
Shirley Cohen wrote:
Hi Java Experts,I agree with Roedy's replacement edit. Of course, to do that you need to use an editor capable of handling regular expressions (vi, microemacs or emacs would all do, or [in extremis] write a program in perl, awk or even Java).
I'm trying to take an existing application and add some custom labels
to the program variables. Specifically, I want to change every scalar
variable to an array type such that I can store the value of the
variable at index 0 of the array and store some label at index 1 of
the array. Rather than manually change every variable one line at a
time, can anyone suggest a more efficient way of doing this?
However, you'd get better advice if you tell us why you need to do this and what you hope to achieve by doing it rather than simply saying how one possible solution might work.
I agree with another Manish: declaring a class rather than using an array would probably be a much better solution. For starters it gets round the obvious problem that a simple array won't hold an int as [0] and a string label as [1].
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
.
- Follow-Ups:
- Re: converting program variables to arrays
- From: Martin Gregorie
- Re: converting program variables to arrays
- References:
- converting program variables to arrays
- From: Shirley Cohen
- converting program variables to arrays
- Prev by Date: Re: Strange applet behaviour on Windows XP
- Next by Date: Re: Reading binary socket data and copying to another socket ?
- Previous by thread: Re: converting program variables to arrays
- Next by thread: Re: converting program variables to arrays
- Index(es):
Relevant Pages
|