download
order Bookmark and Share

 

Fragment Builder

 
Files List Content Splitter Splitter2 Buttons Buttons2 Splitter2 Splitter

Fragments are pieces of code that occur regularly in programs but which can't be encapsulated in procedures. The image shows a typical example of a fragment (Open Jet Database). It consists of a series of lines you use regularly in your code, but which you would normally not encapsulate in a procedure. Which fragments folders are visible in the tree depends on what references the project has. For example if the project has a reference to DAO, it shows the fragments for DAO and not for ADO and visa versa.

Start this dialog from Toolbar or using Alt-CN (Code-vb - Fragment)

Coding using fragment builder consists of selecting the appropriate fragment and moving thru the open parameter positions using tab. At each positions a pop-up lets you select an appropriate action: insert an existing or new variable or expression. A selected variable will automatically replace all parameter positions with the same specification (see below). [Insert] adds the fragment to the current position in the code module. The cursor is automatically moved to the position in the fragment marked with <cursor>.

A selected variable will automatically replace all parameter positions with the same specification

 

Controls:


Fragments organized in folders

The fragments are stored physically as .bas files in folders. The location of this folder can be found from Settings. You can add your own subfolders using Windows Explorer. Only those folders are visible which contain code that uses libraries that are referenced. E.g. Access does not show (content of) Excel folder, unless there is a reference to Excel. If Access has a reference to DAO , DAO fragments are shown and not ADO (unless that was also referenced). This is managed in a file called cvbrefra.ini, located next to the add-in dll file.

List of fragments

Shows the fragments for the folder which is currently selected AND that of all subfolders EXCEPT folders which require a reference.

Selected fragment

Shows fragment and applied variable substitutions.

Splitter

Resize windows.

Use selected fragment

Insert Cancel Help

Insert

Inserts the fragment to the current position in the code module. The cursor is automatically moved to the position in the fragment marked with <cursor>. Uses defaults on not specified parameters.

Cancel

Closes the builder without adding the fragment

Help

Starts this Help topic

Fragments management

New Edit Delete

New

Create a new fragment.

Edit

Edit selected fragment.

Delete

Delete selected fragment.