Results 1 to 9 of 9

Thread: With keyword [can't be resolved]

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    With keyword [can't be resolved]

    VB got at least one thing right with the With keyword. You could use it like this:
    VB Code:
    1. ' Before
    2. Combo1.AddItem "stuff"
    3. Combo1.AddItem "things"
    4. Combo1.AddItem "fun thingies"
    5.  
    6. ' After
    7. With Combo1
    8.     .AddItem "stuff"
    9.     .AddItem "things"
    10.     .AddItem "fun thingies"
    11. End With
    Is there a similar keyword in Java? I'm adding stuff to a vector repeatedly but seeing "slogans.addElement" millions of times looks better like ".addElement."
    Last edited by filburt1; Dec 26th, 2001 at 07:56 PM.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I haven't found anything like that.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Me neither and my mentor at work told me that such a thing doesn't exist.

  4. #4
    Member
    Join Date
    Apr 2001
    Location
    Hamilton, ON, Canada
    Posts
    43
    what's the name of that book DoaK, and is it worth buying?

  5. #5
    DaoK
    Guest
    "How to program in Java" by Deitel and Deitel

    It's a hug book. I use it as a reference but it have a lots of example. Personnaly I have some difficulties to read line by line so I just check fast code and try to learn from them.

    I have the french version of that book ( I know that it have about 150 pages more that the english version ) and it have a lots of detail... a little to much but it's a great book

  6. #6
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Filbert. I used to use the "with" keyword a lot when i programmed in VB but it's been a while. I know it's a short hand notation for being able to set a controls properties without having to refrence the control everytime. But can it be used with "non-gui" objects such as collections? I forget. Thanks

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Dilenger4
    But can it be used with "non-gui" objects such as collections? I forget. Thanks
    Yup, recordsets, collections, etc., all can use With.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    O yeah recordsets! Right. I forgot. I haven't used Visual Basic in awhile. I have to get back into VBA programming for Access. Java is so time consuming

  9. #9
    Hyperactive Member CaptainPinko's Avatar
    Join Date
    Jan 2001
    Location
    London, Ontario, Canada
    Posts
    332
    yeah, i really do wish they would awith keyword, and a mathematical operator for "to the power of", that would make math things a lot nicer<sigh>.....
    "There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein

    If you are programming in Java use www.NetBeans.org

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