SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    AZ
    AZ is offline
    Junior Member
    Join Date
    Nov 1999
    Location
    San Francisco, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scope of data members

    How can I declare private data member inside of user defined class?

    on

    winclass myOne
    {
    private boolean bVar;
    }

    I am getting compiling error
    Any workaround?

    thanks a lot
    Alex


  2. #2
    Member
    Join Date
    Dec 1999
    Location
    Seattle, WA
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Scope of data members

    Didn't know 4test had a private keywork, thanks for pointing this out. From the help I grabbed this...

    "Scope applies to the declarations of constants, variables, data types, functions, windows, and window classes."

    I gather from this sentence that "private" cannot be used on a method or data declaration WITHIN a class as you are attempting, but only on the class declare itself, as well as variables, data types etc.

    If anyone else knows for sure, please share.

    ------------------
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>It doesn't matter if I go to heaven or to hell, I have friends in both places.<HR></BLOCKQUOTE>
    <BLOCKQUOTE]<font size=1 face=Verdana, Arial, Helvetica]quote:</font]<HR]It doesn't matter if I go to heaven or to hell, I have friends in both places.<HR]</BLOCKQUOTE]

  3. #3
    AZ
    AZ is offline
    Junior Member
    Join Date
    Nov 1999
    Location
    San Francisco, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Scope of data members

    Matt,

    in QAP(Silk) winclass.inc file for AnyWin class there is a private data declaration

    private builtin LIST OF WININFO GegWinInfoList()

    I just can not figure out why I can not do the same in my class.

    thanks
    Alex Zadorozhny

  4. #4
    Guest

    Re: Scope of data members

    Notice that

    private builtin LIST OF WININFO GegWinInfoList()

    is a function, not a variable. I don't know the reason for not allowing variables to be declared as private, but that seems to be the way it is. You can declare functions with a private scope without any problems.

  5. #5
    AZ
    AZ is offline
    Junior Member
    Join Date
    Nov 1999
    Location
    San Francisco, CA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Scope of data members

    John,

    Making function private inside of the class, basically do nothing, you can still access them from the outside of the class (from the testcase).
    In the
    private builtin LIST OF WININFO GetWinInfoList()
    the keyword is 'builtin'. This means that called method is part of Segue's executables.
    First I thought it was 'private' so put it as not a good example.

    So the question remains: How to use variable inside of the class but restrict direct access from the testcase?

    Thanks
    Alex Zadorozhny

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Scope of data members

    See the posting on SilkTest forum regarding private methods.

    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:33 AM.

Copyright BetaSoft Inc.