Results 1 to 4 of 4
  1. #1
    draac Guest

    Visual Basic sample codes

    im pretty new on using Visual Basic
    so please speak clear when replying.

    lets say i have some sample codes off the internet
    lets say a clock script

    i have a project all ready started and i would like to add that clock to my project

    how would i transfer the clock and the images and codes to my new project.

    i tryed adding in the forum but i guess since they had the same name it wont work.

    whats the best way to combind these 2 scripts.

    can i even take just parts of a script
    lets say there is 3 buttons and a clock
    but all i want is the buttons and the functions.

    what is the best way to take parts or all codes and transfer them into a project that is all ready started

  2. #2
    Join Date
    Dec 2004
    There isn't a "way" to transfer parts of a program, at least not as simpily as you seem to be implying. You'd have to go through the code looking at what each class/function/block/statement or whatever does. Then go through and implement those functionalities into your project.

    BTW, how familar with VB are you? Just starting out, or have you read a book or two/done several tuts?

  3. #3
    Join Date
    Aug 2004
    It might be easier to move your code into the sample with the clock since you know your own code.
    Sometimes, in madness, resides genius...

  4. #4
    Join Date
    Apr 2005

    Working backwards!!

    When I first started working with VB I found it really hard to figure out which bit of code did what. I also had the same problem as you are having now. I could not get ANY 2 different code and put them together.

    I think the best way (if your new) is to work backward on the form. Double click the object that is in use/or that you want to use and then see what the coding says it is doing. If it is not self explanitory then you could just copy the item and that specific bit of code to your new program. After that try running YOUR program and see what happens.

    At this point you will more than likely get an error saying something is missing and you wont have a clue what it is. The best thing to do now is go back to the original code and do a search on what it says is missing. When you find it make sure you read the code again (helps familiarize you with the code). If you still cant figure out which bit you need then once again just copy that whole block of code to YOUR program. After that just redo the last steps of running the code and seeing what is missing.

    Eventualy you will get it to run if you keep finding what it needs. The best thing for any new coder is to go through tutorials, they helped me alot. After a few tut's I was reading code like I had been doing it for years.

    I dont know if this has helped anyone but hey its always fun writing into a forum.

Posting Permissions

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