SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Jun 2000
    Location
    Sunyyvale CA USA
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    U need to have a valid method or property set to any object.

    ------------------
    Sree
    Sree

  2. #2
    Junior Member
    Join Date
    Apr 2001
    Location
    San Francisco, Ca. USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Compiler constant weirdness

    I am using a compiler constant (_CON) in my code and the following thing happens in 5.03 and 5.5 when _CON is set to FALSE
    if (_CON){
    MainToolBar.Bogus.Click(); //Compiles
    MainToolBar.Bogus(); //Does not compile
    }
    Anyone know why the second line causes Silk to trip up. Why is Silk even trying to compile this code, it is supposed to skip it when _CON == FALSE (at least that's my understanding).

    Thanks.


    ------------------
    Robert

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    Roberto,
    SilkTest will still try to compile the code. It just won't ever run the code with the constant set to FALSE.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Location
    San Francisco, Ca. USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    This is not completely true. Silk does some level of compiling, but not a full compile, otherwise both sample lines above would fail. To be sure, I changed the compiler constant to a constant and Silk came up with a lot of compile errors.

    Why do I need a valid method for every object, especially if the object itself is not valid?

    ------------------
    Robert

  5. #5
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    I am completely lost here... I didn't even know that there's compiler constants in Silk. Even the online help doesn't have anything about that thing.

    The only closest thing that I know of that would be evaluated at compile time are GUI specifiers (i.e. explorer, netscape, msw)

    And as you were saying, "...I changed the compiler constant to a constant..." isn't it a constant already???

    Would somebody please clear things here... It really is a cool thing if I could use compiler constants in Silk aside from the GUI specifiers that I know.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by roberto:
    This is not completely true. Silk does some level of compiling, but not a full compile, otherwise both sample lines above would fail. To be sure, I changed the compiler constant to a constant and Silk came up with a lot of compile errors.

    Why do I need a valid method for every object, especially if the object itself is not valid?

    <HR></BLOCKQUOTE>



    ------------------
    kalabog73@hotmail.com

  6. #6
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    hmmm... ok, just found what you are talking about here. I didn't even pay attention to that thing before. Never used this before but it looks like it will be helpful.


    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by kalabog:
    I am completely lost here... I didn't even know that there's compiler constants in Silk. Even the online help doesn't have anything about that thing.

    The only closest thing that I know of that would be evaluated at compile time are GUI specifiers (i.e. explorer, netscape, msw)

    And as you were saying, "...I changed the compiler constant to a constant..." isn't it a constant already???

    Would somebody please clear things here... It really is a cool thing if I could use compiler constants in Silk aside from the GUI specifiers that I know.



    <HR></BLOCKQUOTE>



    ------------------
    kalabog73@hotmail.com

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    I think you use _con the wrong way. It's probably not used like this since it tries to use it as normal variable.

    It's certainly not like #ifndef - #endif kind of stuff as in c. So you must be missing something.

    Anyhow what's this _CON used for anyway.

    ------------------

  8. #8
    Junior Member
    Join Date
    Apr 2001
    Location
    San Francisco, Ca. USA
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    Its not completely the same as using a normal constant. Referencing undefined objects with an anywin method will not compile using normal booleans but will using compiler constants. (See my original message.)

    The idea for using them is to be able to use one script file for three similar (but not the same) applications. In the areas they are different, use comp. constants in the class and method definitions so that the same methods can be called from the scripts. I was hoping they may be #IFDEF, but obviously not. But these constants are not normal constants either. Somewhere in between. Too bad because they could be used in very elegant ways.

    ------------------
    Robert
    Robert

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compiler constant weirdness

    Are you trying to branch your code so it will work differently with dffirent _con value using minimum code???

    If so that can be done using other ways.
    For example functions, global values....

    ------------------

 

 

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:14 PM.

Copyright BetaSoft Inc.