Home
Why Macro Express®
PGM Functions Library™ 
PGM Functions Library™ Source Code 
Downloads 
About Us
Newsgroup

  Official PayPal Seal  


Last updated

Source Code

PGM Functions Library™ Source Code is available for most of the functions, the exceptions being the non-example functions in both the PGM System and Variable Management categories. When we refer to source code, we mean the password protection feature of Macro Express. The source code library file, PGMFLSource.mex, is identical to the standard library file, PGMFL.mex, except for the passwords, in-line documentation, and comments and may be purchased from the Macro Express web site.

The PGM Functions Library™ contains over 150 functions in 8 different categories, with over 14,000 lines of code. Source code is available for over 130 of these functions, and is a great thing to own. With it you can learn how to create reusable functions, customize how our functions work, investigate questions from people in your department or your clients, or simply satisfy your curiosity.

The source code is heavily commented throughout each function. Here is an example taken from the header section of the {Program - Launch} function:

// PF:{ Program - Launch }
//PN:ProgName,WinTitle,ProgFolder,ProgParams,LaunchState,ExactMatch,LaunchDelay,VerifyLoops,VerifyDelay,ValidateParams
// PA: PName,WTitle, Phone,PParams,WShow, Exact,LDelay,VLoops, VDelay,Vparams
// PT:S,S,SO~,SO~,SO,NO0,NO,NO,NO,NO
//PD:ProgramName,WindowTitle,ProgramFolder,ProgramParameters,LaunchState,ExactMatch?,LaunchDelay,VerifyLoops,VerifyDelay,ValidateParameters
//PW: ***** DO NOT CHANGE ANY OF THE LINES ABOVE AND INCLUDING THIS ONE! *****

//--------------------------------------------------------------------------
// Professional Grade Macros & Pnambic Systems Pty. Ltd.
// Floyd P Watergil - floyd@pgmacros.com
// Paul Thornett - pault1@hotkey.net.au
//--------------------------------------------------------------------------

// Purpose -
// Launches a program and informs user of success or failure.

// Parameters -
// ProgramName = Name of program to run.
// ProgramFolder = Folder where program is run.
// WindowTitle = Name of program's window.
// ExactMatch? = True or false flag to determine if the passed WindowTitle parameter is an
// exact or partial match. 1 means true and 0 means false. Defaults to partial match (0).
// ProgramParameters = Command line string to pass to program.
// LaunchState = Program window to be normal, minimized, or maximized after launch. Defaults
// to normal.
// LaunchDelay = Number of seconds to wait after launching. Defaults to 0 (zero) seconds.
// VerifyLoops = Number of loops to verify that program has launched, the window title is
// running, and the window is on top. Defaults to 50 loops.
// VerifyDelay = Number of milliseconds to wait between verify loops. Defaults to 500
// milliseconds.
// ValidateParameters? = Flag to check passed parameters for valid data or values. If set to
// zero (the default) then it's assumed that all the parameters are correct and no
// validation takes place.

// Returns -
// If no error occurs or program already running:
// ReturnError? = 0
// If an error occurs:
// ReturnError? = 1

// Notes -
// When determining if the passed program file name exists, this function enables the "Use
// Search Path" feature. If a folder name is passed, it's prepended to the program name so
// pass either a full path (folder and program name), or a separate folder and program name.
// Do not pass both.

// Variable management -
// All variables are saved upon entering and restored prior to exiting. The clipboard is
// not used at all.

// Local variables -
// T1, T2, T3, N2, and N3 = Temporary variables
// T9 = This function name
// T10 = Program name - ProgramName
// T11 = Program folder - ProgramFolder
// T12 = Program file parameters - ProgramParameters
// T13 = Launch state - LaunchState
// T15 = Command string
// T16 = Window title - WindowTitle
// T17 = Full program path and name
// N1 = Error flag - ReturnError?
// N9 = Validate passed parameters - ValidateParameters?
// N11 = Launch delay seconds - LaunchDelay
// N12 = Verify loops - VerifyLoops
// N13 = Verify delay milliseconds - VerifyDelay
// N15 = Exact match flag - ExactMatch?
//

With source code you can learn how others create real-time, live macro applications by building complex functions with basic Macro Express commands. Learn how to:

  • Use the advanced Window Control commands
  • Run a complete macro from a variable
  • Control program flow using constructs such as Switch/End Switch, and Case/End Case
  • Handle If/Else/End If situations, including the use of AND, OR, and XOR
  • Use loops in your macros for repeat operations
  • Launch, activate, and terminate programs and windows of other applications
  • Reposition other windows on your desktop
  • Minimize and maximize windows
  • Process ASCII text files
  • Create modify, and delete variables
  • Set variables from prompts, files, and the clipboard
  • Set variables from Window objects, environment space, and other variables
  • Set values based on ASCII characters
  • Convert variables from one type to another
  • Perform arithmetic operations with variables
  • Convert file names from Windows to DOS style names
  • Work with date and time strings
  • Pause and delay macros
  • Put a macro in a wait state until an event occurs
  • Read and write data to and from your Windows Registry, environment space, and files
  • Create and delete Registry keys and values
  • Use Ping to determine if you are on-line
  • Create prompts and menus for your end users
  • Use Macro Express to email messages
  • Display messages to the user to give them options