|
-
Nov 19th, 2003, 05:57 PM
#1
Thread Starter
Hyperactive Member
Public Variables
hi,
I been using 'Netbeans' (hides in shame) to make a java program and I need to add a login ID to a public variable, but I need that to be available to the other forms, as it is required for saving data to the database.
I know you can just set a public var in a module in VB and all forms can use it.
is what I requiring a Global Variable? if these are used in Java...
Any help on, how and where to delcare this variable would be gratefully recieved.
Thank you all in advanced
-
Nov 19th, 2003, 06:03 PM
#2
No need to be ashamed of NetBeans, it's a great IDE (except that mine isn't starting ).
You can simulate a global variable by making it a static property of some class.
However, depending on your app design there may be a better solution.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 07:13 AM
#3
Thread Starter
Hyperactive Member
lol...
well how do I do that? I mean make it apart of a class?
oh, and I can create test files, with IO, but how to get the app.path (thats the vb.net value anyway) so that I can save the file in this directory:
(App.Path) + "System\Text1.txt"
Thank you,
If you can help me with this I wont need the global variable.
-
Nov 21st, 2003, 10:54 AM
#4
System.getProperty is to retrieve various properties, I think the application path might be one of them.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 04:19 PM
#5
Thread Starter
Hyperactive Member
thanks very much, 
I think I should just PM you when I got a question lol
-
Nov 21st, 2003, 05:31 PM
#6
No you shouldn't. PMs are not searchable, so other people would have to ask the same question again, I'd get annoyed and would leave
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 07:14 PM
#7
Thread Starter
Hyperactive Member
I was joking
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|