Results 1 to 14 of 14

Thread: [RESOLVED] How to add many .bas modules to project

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Resolved [RESOLVED] How to add many .bas modules to project

    I have VB project that needs 30+ .bas modules added. How do I add these without selecting one at a time. Like in C you can do multi-select but I don't see that feature in VB


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,937

    Re: How to add many .bas modules to project

    Edit the VBP file with notepad.

    30 doesn't seem like a lot to add and drop though.

    The primary project I work on these days has 44 BAS modules, 118 FRM modules, 30 CLS modules, and 8 CTL modules, in addition to a 70 meg RES file.
    Last edited by Elroy; Oct 21st, 2014 at 01:31 PM.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to add many .bas modules to project

    I can 30 .bas modules quicker than waiting for a response to this thread but this is just one of many projects and it would be nice to know an easy way as later I will have VB projects with many more than 30

    Seems like editing the vbp file would be much more work than just adding them one at a time as I would have to type in the name of each module.

    So let's say I make a quickie VB project to load the file names from disk and then save them in a text file then open up vbp in notepad and add the text file of the module names. Even that is more work than adding the modules one at a time.
    Last edited by jmsrickland; Oct 21st, 2014 at 01:49 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to add many .bas modules to project

    You can drop as many as you'd like, assuming they are all in the same folder.

    Trick: don't do it from VB. Open Windows explorer, navigate to folder with the bas files. Select the ones you want & drag drop them on to the VB IDE explorer window/tree
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to add many .bas modules to project

    Don't understand .....drop them on to the VB IDE explorer window/tree

    What is IDE explorer window/tree


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to add many .bas modules to project

    Quote Originally Posted by jmsrickland View Post
    Don't understand .....drop them on to the VB IDE explorer window/tree

    What is IDE explorer window/tree
    Project Explorer is the official name I think. It's the window in IDE where you can add/remove/open project items (right side, near top of IDE)
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: How to add many .bas modules to project

    That is SO cool! I see copy-paste does not work, but dragging dropping does....Thanks LaVolpe....good thing to remember! - Sam

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to add many .bas modules to project

    Quote Originally Posted by SamOscarBrown View Post
    That is SO cool! I see copy-paste does not work, but dragging dropping does....Thanks LaVolpe....good thing to remember! - Sam
    Kinda neat, I agree. However, keep in mind that these are not copies. You make changes to the dropped items & if any other projects are using those too, the changes effect them.

    I use it kinda like this:
    In my new project folder, I'll copy bas, cls files to that folder. Then from within that folder, drag drop to IDE. Now, I'm working with copies & not originals.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #9
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: How to add many .bas modules to project

    Yeah, kinda figured that...but glad you clarified for all.

  10. #10
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,440

    Re: How to add many .bas modules to project

    Why not just code a small tool?
    Something like:
    1) Please select your VBP-File
    2) Please select the BAS (or other Modules) you want to import to the previously selected VBP-File (Multiselect! DriveList+FileList etc. the usual)
    3) Please select a destination folder for the Modules (Subfolder of VBP-File?). Optional to copy them or to use the "original" ones
    4) Copy (or just import) the selected Modules (See step 3)
    5) Code to edit the VBP-File
    6) Save changes to vbp-file
    Done

    Doesn't sound too complicated
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: How to add many .bas modules to project

    Quote Originally Posted by Zvoni View Post
    Why not just code a small tool?
    Something like:
    1) Please select your VBP-File
    2) Please select the BAS (or other Modules) you want to import to the previously selected VBP-File (Multiselect! DriveList+FileList etc. the usual)
    3) Please select a destination folder for the Modules (Subfolder of VBP-File?). Optional to copy them or to use the "original" ones
    4) Copy (or just import) the selected Modules (See step 3)
    5) Code to edit the VBP-File
    6) Save changes to vbp-file
    Done

    Doesn't sound too complicated
    Perhaps not complicated but not as easy as drag and dropping. :-)
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,440

    Re: How to add many .bas modules to project

    Quote Originally Posted by dee-u View Post
    Perhaps not complicated but not as easy as drag and dropping. :-)
    Yes, if you want to import the original module, but if you want a copy, because you know you'll have to change something in it, you have to copy the module(s) manually beforehand.

    By coding a small tool you kill all birds with one stone.

    You could even code this tool as a small repository with descriptions, what functions are in that module, what they're doing etc....
    ...that is, if something like this doesn't exist already (wouldn't be surprised)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  13. #13
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,937

    Re: How to add many .bas modules to project

    Hmmm, for small projects (which I would call something like 50 or less files, excluding the ??x files), I just tend to start a folder and copy the files I need into it. These "start up" files tend to come from two places: 1) copied out of other projects I'm working on, or 2) copied out of a huge repository of files I have organized into 100s of folders and subfolders. However, that repository is a bit scattered so I tend to start with copies of "AllPurpose..." modules from existing projects. (And as stated elsewhere, I NEVER share the same file with two VBP projects. I truly think that's a horrible idea.)

    Once projects grow beyond 50 or so modules (FRM, BAS, CLS, CTL), I tend to stop and reorganize them into sub-folders, possibly one for BAS, one for CLS, one for CTL, and potentially several for the FRM/FRX files. And, in the root of that sub-folder system sits the VBP, the RES, the .manifest, and any project wide programming notes I may have (typically in a ProjectName.txt file). Just as an aside, if a project evolves, I may also have a Dependencies, HelpFiles, OfficeTemplates, and Website subfolders.

    IDK, this is just the organization that I've evolved over the years. I'm sure everybody has their own way of doing it. That's just mine.

    And yeah, the drag-and-drop method outlined by LaVolpe works well. (Truth be told, I misunderstood the original question of this thread.)

    Happy Programming,
    Elroy

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: How to add many .bas modules to project

    Quote Originally Posted by LaVolpe View Post
    Project Explorer is the official name I think. It's the window in IDE where you can add/remove/open project items (right side, near top of IDE)
    Excellent. LaVolpe. Thanks a lot


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

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