Table Of Contents

Organizing Code to Avoid Name Collisions

Version:
    Last Modified: August 31, 2017

    A namespace is a container used to organize files into logical groups. Items in the same namespace must have a unique name. Namespaces help to prevent name collisions.

    1. Open an Application or Library document.
    2. On the document toolbar, click New»Add namespace.
    3. Rename the namespace.
      spd-note-tip
      Tip  

      Give your namespace a meaningful name to indicate that the namespace contains files of the same logical group.

    4. Drag files from the project to the namespace.
    5. Optional: Rename the files as necessary. Different namespaces can contain files that have the same name. For example, the Main VI namespace and the SubVI namespace in the same Application or Library document can each contain a file named Function.gvi.
    6. Click File»Save all to save all files.
    After you build an application, each namespace corresponds to a folder in the output directory.

    Recently Viewed Topics