IDEASnippets

Verify if integer

This if ... then statment will verify if a string inputed from a custom function is an integer

Get the field name

This function will get a field name of a field given its location within the database.  If the location is -1 it will default to the last field name.

I have updated the script, it now uses 0 to find the last entry and negative numbers to find the field name starting from the right.

Check if field name exists

This routine will check to see if a field name exists and if it the field name already exists then it will return a field name that does not exist by adding a 1 to the end of the field name.

Get no of records

This function will get the number of records in a database.

Get File Name

A function to obtain the file name from a string that also contains the directory info.  This was updated on April 4, 2012 to add functionality for files that may be in sub directories.  Also added functionilty where you can get the file name or the file name with the directory imbedded in the IDEA working directory.

Field Dialog

This code creates a menu that allows you to pick multiple fields.  The code should be inserted as part of the menu structure and as part of the menu, usually based on a select statement option of a button being selected from the main menu.

Adding a timer to the script

You can add the following lines to a script to check how long it takes to process.  The commented lines show how to get the date and time.  The timer gives the seconds and milliseconds so it is great for using as a timer.

Since the Timer function counts seconds from midnight if your run time passes midnight then it will return an inaccurately large result.

Progress Bar

The following code will set-up the variables, display the progress bar and update it.

Find Files from a directory

This script will optain the files of a certain type located in the specified directory. 
path is the directory
ext is the extension such as txt for text files or imd for idea files
files() is the array that will hold all the files that are returned.

Pages