473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

List Variables & Type

Is it possible to extract all the used variables (&type) from a piece of
sourcecode, rather than doing it manually?

Cheers,
Dave
Jul 17 '05 #1
2 4110
It is not clear what you mean exactly by "extract all the used variables
(&type)".

Dave wrote:
Is it possible to extract all the used variables (&type) from a piece of
sourcecode, rather than doing it manually?

Cheers,
Dave

Jul 17 '05 #2
nos

"Dave" <bigdavepotnoodle*SPAM*hotmail.com> wrote in message
news:3f***********************@news-text.dial.pipex.com...
Is it possible to extract all the used variables (&type) from a piece of
sourcecode, rather than doing it manually?

Cheers,
Dave

Suppose your class is Plot1();
You can use reflection class methods.
The following (needs to be tested)
fragment prints out all fields. Also
look at "getFields()"
It gives you something like this:
private static AlignRight Plot1.ar
for each field.
----

Plot1 p1 = new Plot1();
Class className = p1.getClass();

Field[] fields = className.getDeclaredFields();

for (int i = 0; i < fields.length; i++) {
System.out.println(fields[i]);
}
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: C White | last post by:
I've got another drop list problem I am using the following code where users select a name, but it should pass a name and email into the table <select name="user"> <option value="<%...
2
by: Mark Hannon | last post by:
I am trying to wrap my brain around storing form elements inside variables & arrays before I move on to a more complicated project. I created this simple example to experiment and as far as I can...
6
by: jena | last post by:
hello, when i create list of lambdas: l=] then l() returns 'C', i think, it should be 'A' my workaround is to define helper class with __call__ method: class X: def __init__(self,s): self.s=s...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
9
by: Don | last post by:
Say I have a class like so: Public Class MyClass Public Prop1 as Integer Public Prop2 As Integer Public Prop3 As Integer End Class Is it possible to retrieve a list of the variables or...
5
by: SKumar | last post by:
Hi All, I have a list which contains my class objects. My class is having two variables. I want to sort the list based on these two variables. Ex : class Foo { ... ...
2
by: smartic | last post by:
i'm having three lists when i select from any one the others be visible by hierarchy but it takes to long to write my code is there is another away to write this code like XML that is my javascript...
5
by: googletired | last post by:
On my current site, I can click on a category and the view the content of that category. This is fine, but now I want to be able to view the contents of *ALL* the categories in one continous scroll...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.