SPONSORS:






User Tag List

Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Coding Challenge #3

    Create a TextField class which defines a SetText method which can accept either a STRING or a LIST OF STRING and sets the text in the text field accordingly.

    Extra points for comments and clarity

    10,000 points to the winner.



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

  2. #2
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Coding Challenge #3

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

    [This message has been edited by Carrick1973 (edited 06-18-2002).]

    [This message has been edited by Carrick1973 (edited 06-18-2002).]

    [This message has been edited by John Green (edited 06-18-2002).]

    [This message has been edited by Carrick1973 (edited 06-18-2002).]
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  3. #3
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Coding Challenge #3

    OK - Does that mean I will be a guru now with 10,000 more points?
    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

    [This message has been edited by Carrick1973 (edited 06-18-2002).]
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Coding Challenge #3

    Dang - I missed this one completely (had actual work to do today )

    John, I have to ask, are these points like the points that Drew Carey gives out on "Who's line is it anyway" ? Can we do anything with these points, like trade them in for a t-shirt or a trip to Bermuda?

    ------------------
    Tom
    Tom

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

    Re: Coding Challenge #3

    Tom,

    These are definitely "Drew Carrey" points! But, I have Automaton Expertise shirts. AJ has qaforums coffee mugs, I think.

    John

  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: Coding Challenge #3

    Tom,

    The right answer has not yet been posted!!!! Dive right in.

    John

  7. #7
    Senior Member
    Join Date
    Jul 2000
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Coding Challenge #3

    quick and dirty

    [ ] type myType is string, list of string
    [ ]
    [-] winclass MyTextField : TextField
    [-] void SetText(myType sText)
    [-] switch(TypeOf(sText))
    [-] case string
    [ ] SetText (sText)
    [-] case LIST OF STRING
    [ ] SetMultiText (sText)


    ------------------
    Tom
    Tom

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

    Re: Coding Challenge #3

    John Green:

    "The right answer has not yet been posted!!!! "

    Are you sure that our asnwers are not correct? I wonder if your question is well formed instead.

    tmason: you answer is the same as the rest of us, except with no error handling. Also you are not handling the optional arguments from the original SetText().

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

  9. #9
    Senior Member
    Join Date
    Jul 2000
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Coding Challenge #3

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by GodKnows:
    tmason: you answer is the same as the rest of us
    <HR></BLOCKQUOTE>

    It's pretty darned close, as a matter of fact it started out as a copy and paste. I believe I made a significant change though, in that I am not accepting an ANYTYPE parameter, but instead a type that I defined. I am sure I am not 100% correct, I just figured I'd take a stab...Good luck GKs


    ------------------
    Tom
    Tom

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

    Re: Coding Challenge #3

    GK,

    Tom's answer is not the same as yours.

    In your code, if the user entered:

    wTextField.SetText (3), it would compile, but a runtime error would be generated by your code.

    In Tom's code,

    wTextField.SetText (3) wouldn't compile. The use of the overloaded data type forces the user to use one of the specified types.

    SilkTest does this with Select (LISTITEM)

    You can do

    wListBox.Select (1) OR
    wListBox.Select ("abc")

    but you can't do

    wListBox.Select ({"abc", "def"})

    Select only accepts the LISTITEM datatype, which is defined as

    type LISTITEM is STRING, INTEGER

    Hope this helps

 

 
Page 1 of 3 123 LastLast

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 05:52 AM.

Copyright BetaSoft Inc.