Results 1 to 21 of 21

Thread: How do I add 2+2

  1. #1
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 01
    Location
    England
    Posts
    1,247

    How do I add 2+2

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  
    5.     Dim np As CNumberProcessor
    6.     Dim no As cNumberOperator
    7.     Dim n1 As CNumber
    8.     Dim n2 As CNumber
    9.    
    10.     Set np = New CNumberProcessor
    11.     Set no = New cNumberOperator
    12.    
    13.     n1.Operand.Add 2
    14.     n2.Operand.Add 2
    15.     no.Operator = "+"
    16.    
    17.     np.AddOperator no
    18.     np.AddOperand n1
    19.     np.AddOperand n2
    20.     np.Process
    21.    
    22.     Debug.Print np.Result
    23.    
    24. End Sub

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  
    5.     Dim n1 As Long
    6.     Dim n2 As Long
    7.    
    8.     n1 = "2"
    9.     n2 = "2"
    10.    
    11.     Debug.Print n1 + n2
    12.    
    13. End Sub

    I know which way I prefer.

    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  2. #2
    Frenzied Member kfcSmitty's Avatar
    Join Date
    May 05
    Location
    Kingston, Ontario
    Posts
    1,789

    Re: How do I add 2+2

    With a bucket dear yrwyddfa, dear yrwyddfa, dear yrwyddfa, with a bucket dear yrwyddfa, dear yrwyddfa add it

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 02
    Location
    Camden, London Mode: PPI
    Posts
    4,904

    Re: How do I add 2+2

    I usually do it in my head. I'm smart like that
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 01
    Location
    England
    Posts
    1,247

    Re: How do I add 2+2

    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  5. #5
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: How do I add 2+2

    Is that your witty sideways glance at OOP? Oh what a wag you are.
    I don't live here any more.

  6. #6
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 01
    Location
    England
    Posts
    1,247

    Re: How do I add 2+2

    I didn't think it was witty, nor sideways
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  7. #7
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: How do I add 2+2

    Neither did I.

  8. #8
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 01
    Location
    England
    Posts
    1,247

    Re: How do I add 2+2

    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

  9. #9
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: How do I add 2+2


  10. #10
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 02
    Location
    @ Opera Software
    Posts
    10,191

    Re: How do I add 2+2

    python:
    Code:
    print str(2 + 2)

  11. #11
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: How do I add 2+2

    Quote Originally Posted by NoteMe
    python:
    Code:
    print str(2 + 2)
    Wow man, this python sounds REALLY advanced
    I don't live here any more.

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 02
    Location
    Camden, London Mode: PPI
    Posts
    4,904

    Re: How do I add 2+2

    PHP:
    PHP Code:
    echo (2); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 02
    Location
    @ Opera Software
    Posts
    10,191

    Re: How do I add 2+2

    Quote Originally Posted by wossname
    Wow man, this python sounds REALLY advanced

    Yeah it is...it kills me just thinking about it....at the moment my work here at CERN evolves using python to steal from someone in Japan..

  14. #14
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: How do I add 2+2

    Quote Originally Posted by NoteMe
    Yeah it is...it kills me just thinking about it....at the moment my work here at CERN evolves using python to steal from someone in Japan..
    My work never evolves.

  15. #15
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 02
    Location
    @ Opera Software
    Posts
    10,191

    Re: How do I add 2+2

    Quote Originally Posted by mendhak
    My work never evolves.


    Come to CERN. You can become my 3rd secretary......your first job will be to massage my shoulders. They are hurting, and I need a massage befor I am going to play football today..



    ØØ

  16. #16
    Banned timeshifter's Avatar
    Join Date
    Mar 04
    Location
    at my desk
    Posts
    2,467

    Re: How do I add 2+2

    I rely on SandpaperTM to do my math for me.

  17. #17
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 02
    Location
    is everything
    Posts
    627

    Re: How do I add 2+2

    What is this "math" I keep hearing about?
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  18. #18

  19. #19
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 05
    Location
    Los Angeles, Univ. of Southern California
    Posts
    2,938

    Re: How do I add 2+2

    go back to kindergarten

  20. #20
    Supreme User Madboy's Avatar
    Join Date
    Oct 03
    Location
    England
    Posts
    3,253

    Re: How do I add 2+2

    Quote Originally Posted by visualAd
    I usually do it in my head. I'm smart like that
    I dont think i can quite manage that, my brain isnt quite advanced enough, it struggles to manage 1+1, ABC = XYZ

  21. #21
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: How do I add 2+2

    6 x 9 = 42

    Douglas Adams proved it.

Posting Permissions

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