Results 1 to 3 of 3

Thread: How to declare a variable to be public only to the other class modules in the project

  1. #1
    Guest

    Question

    Hi
    I'm trying to build a simple database servises object,that includes several classes, and one of the classes is database preparation class wich prepepres the database and opens it, and it uses the variable DB as database, to contain the reference to the opened database.
    now the question is to declare the DB variable so it will be available only for the classes included in the contained project,meaning only the classes in the project, that refere to DB for the services they provide.
    actually,I could declare DB as public, but then,I expose DB to whichever using the classliberary I've created.
    I'm trying to find something equivalent to the Friend declaration of procedures, but for variables,I've tried enforcing friend with the DB declaration, but it didn't work.

    any Ideas??????
    pls help(I'm quite novice with this stuff...)
    Thank you all in advance
    Shmulik

  2. #2
    New Member
    Join Date
    Jul 2000
    Location
    Saarbrücken, Germany
    Posts
    10
    Add a module to your project and declare a variable as public. That's all.

  3. #3
    Guest

    Thumbs up

    Thanx

    So simple....
    It works!

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