Results 1 to 7 of 7

Thread: Public Variables

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    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
    §tudz

    Studzworld.com - Portfolio

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    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.
    §tudz

    Studzworld.com - Portfolio

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    thanks very much,


    I think I should just PM you when I got a question lol
    §tudz

    Studzworld.com - Portfolio

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271
    I was joking
    §tudz

    Studzworld.com - Portfolio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width