Page 1 of 2 12 LastLast
Results 1 to 40 of 69

Thread: Lets Build a Program

  1. #1

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Lets Build a Program

    Im bored and have a creative idea for this thread. Lets build a program in VB one line at a time until we create a monstrosity assuming this ends up a super thread like post race.

    Here are the rules:

    1. It can only be one line at a time.
    2. It must be in VB.Net
    3. It must contain line numbers.
    4. If a line needs deleted, say Delete (your line number here).
    5. Troll posts and full sub routines/functions are not allowed and will be disregarded.
    6. If there is a syntax error, say Syntax Error (your line number here)


    I will start

    Code:
    000 Option Explicit On

  2. #2
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Lets Build a Program

    Quote Originally Posted by Jacob Roman View Post
    Im bored and have........
    Lol....just married and already bored?

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Lets Build a Program

    Code:
    002 Me.Close

  4. #4
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Lets Build a Program

    Quote Originally Posted by Jacob Roman View Post
    Im bored and have a creative idea for this thread. Lets build a program in VB one line at a time until we create a monstrosity assuming this ends up a super thread like post race.

    Here are the rules:

    1. It can only be one line at a time.
    2. It must be in VB.Net
    3. It must contain line numbers.
    4. If a line needs deleted, say Delete (your line number here).
    5. Troll posts and full sub routines/functions are not allowed and will be disregarded.
    6. If there is a syntax error, say Syntax Error (your line number here)


    I will start

    Code:
    000 Option Explicit On
    That's very similar to some of the requirements I get here at work. The old "just start coding and I'll get you the requirements tomorrow".
    Please remember next time...elections matter!

  5. #5
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Where the dirt bikes and ATVs play
    Posts
    80

    Re: Lets Build a Program

    Quote Originally Posted by TysonLPrice View Post
    That's very similar to some of the requirements I get here at work. The old "just start coding and I'll get you the requirements tomorrow".
    It's either that or "here's some buggy, unstable code written twelve years ago. Make it work."
    "Bones heal. Chicks dig scars. Pain is temporary. Glory is forever." - Robert Craig "Evel" Knievel
    “Leave me alone, I know what I’m doing.” - Kimi Raikkonen

  6. #6
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Lets Build a Program

    that's easy...

    Code:
    001 On Error Resume Next 'Gotta sneak this in before the close.
    that should take care of any errors.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Lets Build a Program

    000 Option Explicit On
    001 On Error Resume Next 'Gotta sneak this in before the close.
    002 GC.Collect < Your missing this vital line !!!!
    003 Me.Close
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  8. #8

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Delete 003

  9. #9
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    I'd like to see where this goes.

    Code:
    002 Option Strict On
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  10. #10

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    003 Public Structure Vector

  11. #11
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    004 Private _x As Int32
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  12. #12
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Lets Build a Program

    Code:
    005 Dim Enchilada As Boolean

  13. #13

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    006 Public X As Integer

  14. #14
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Lets Build a Program

    It was a dark and stormy night....
    Please remember next time...elections matter!

  15. #15
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Lets Build a Program

    Code:
    007 'I am not sure where this is going, but it looks great.

  16. #16

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    008 Public Y As Integer
    I feel like were a bunch of monkeys trying to get an automobile running lol

  17. #17
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Lets Build a Program

    Quote Originally Posted by NeedSomeAnswers View Post
    000 Option Explicit On
    001 On Error Resume Next 'Gotta sneak this in before the close.
    002 GC.Collect < Your missing this vital line !!!!
    003 Me.Close
    Have you tried declaring any of these at form scope?

  18. #18

  19. #19

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    009 End Structure

  20. #20
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    010 Public Structure Vector3
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  21. #21

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    011 Public X As Integer

  22. #22
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    012 Public Y As Integer
    FYI It's bad practice to use Public variables over Public properties.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  23. #23
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Lets Build a Program

    0013 Label01:

    Guess where I plan to GoTo with that line of code...
    Please remember next time...elections matter!

  24. #24
    Frenzied Member Gruff's Avatar
    Join Date
    Jan 2014
    Location
    Scappoose Oregon USA
    Posts
    1,293

    Re: Lets Build a Program

    Private HellFreezesOver as boolean = False
    Burn the land and boil the sea
    You can't take the sky from me


    ~T

  25. #25
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: Lets Build a Program

    I normally don’t play with these threads but this did make me laugh so according to the rules:-

    Code:
    014 Dim myRandom As New Random

  26. #26
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: Lets Build a Program

    Code:
    015 MessageBox.Show(String.Join(" ", Enumerable.Range(0, myRandom.Next({"you", "are", "all", "going", "Bonkers", "when", "marriage", "should", "be", "the", "most", "memorable", "Time", "in", "your", "life", "however", "fun", "things", "can", "happen", "when", "you", "least", "expect", "them", "to"}.Length - 1) + 1).Select(Function(x) {"you", "are", "all", "going", "Bonkers", "when", "marriage", "should", "be", "the", "most", "memorable", "Time", "in", "your", "life", "however", "fun", "things", "can", "happen", "when", "you", "least", "expect", "them", "to"}(myRandom.Next(0, {"you", "are", "all", "going", "Bonkers", "when", "marriage", "should", "be", "the", "most", "memorable", "Time", "in", "your", "life", "however", "fun", "things", "can", "happen", "when", "you", "least", "expect", "them", "to"}.Length))).ToArray), "Warning! Bonkers Going On Here!", MessageBoxButtons.OK, MessageBoxIcon.Warning)

  27. #27

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Error 015

    You cant have a messagebox in a structure

    Delete 015

  28. #28
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    015 Public Z As Integer
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  29. #29

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    016 End Structure

  30. #30
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    017 Public Module VectorConversions
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  31. #31
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Lets Build a Program

    Code:
    020 REM This is a prime example of why our projects miss deadlines and go over budget
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  32. #32

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    021 Public Vec As Vector3

  33. #33
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Lets Build a Program

    Code:
    022 Vec.X = 1
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  34. #34

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Error 022
    Can't put values in variables in the general declarations. Only for initialization
    Delete 022

  35. #35
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Lets Build a Program

    Code:
    022 Public Function ConvertToVector2(ByVal value As Vector3) As Vector2
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  36. #36

    Thread Starter
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Lets Build a Program

    Code:
    023 Dim Result As Vector2

  37. #37
    New Member _God_'s Avatar
    Join Date
    Apr 2013
    Posts
    0

    Re: Lets Build a Program

    Code:
    024 Result.X = value.X

  38. #38
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Lets Build a Program

    025 Goto Label01
    Please remember next time...elections matter!

  39. #39
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,836

    Re: Lets Build a Program

    026 MsgBox "April Fools!"
    Please remember next time...elections matter!

  40. #40
    New Member _God_'s Avatar
    Join Date
    Apr 2013
    Posts
    0

    Re: Lets Build a Program

    Quote Originally Posted by TysonLPrice View Post
    025 Goto Label01
    Error 025
    Label01 does not exist
    Delete 025

    Delete 026

Page 1 of 2 12 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
  •  



Click Here to Expand Forum to Full Width