Online courses

Customer login

Glossary

QuickField Help

FAQ

Main >> Support >> QuickField Help

LabelMover Programming Overview

Help contents

Starting from version 2.1 it is possible to control LabelMover operations programmatically.

This opens wide range of possible applications, including

Two kinds of programming interfaces to LabelMover are supported: COM interface and command line interface.

COM Interface

Functions

Typical sequence of operations when working with LabelMover COM interface is the following:

Example

Let us consider a very simple example. Suppose we have some QuickField problem and suppose we specified several parameters (variations) and several results for it using LabelMover.

We would like to set values 0.0, 0.1, 0.2 … 0.9 to one parameter, set values 0.0, 0.01, 0.02 … 0.09 to another parameter and get table of all possible combinations. (That is, we would like to generate 100 variants of the problem).

This is an example that does it in Visual Basic 2005:

Sub Main()
    Dim qlm As QLM.SimpleInterface
    qlm = CreateObject("QLM.SimpleInterface")
    qlm.ClearResults()
    Dim i, j As Integer
    For i = 0 To 10
        For j = 0 To 10
            qlm.SetVariation(0, i * 0.1)
            qlm.SetVariation(1, j * 0.01)
            qlm.Solve()
        Next
    Next
End Sub

Remark:To use this code you should manually start LabelMover and ensure that it is in Optimization analysis mode and that at least two variations are specified.

Command Line Interface

You can use command line interface if you use programming language or environment that does not support COM. Also, even for programming languages that support COM, using the command line interface could be easier.

All you should know is how to execute external program (EXE file) with command line parameters in your program.

There is a special program QLMCall.exe in the LabelMover installation. To control LabelMover you just should execute QLMCall.exe with variation values (or additional commands) as parameters.

Command Line Parameters

Example

Les us rewrite the simple example described above using the command line interface:

Sub Main()
    Dim i, j As Integer
      Dim commandLine As String
      Shell("QLMCall ClearResults", , True)
      For i = 0 To 10
        For j = 0 To 10
            commandLine = "QLMCall " + _
                Str(i * 0.1) + " " + Str(j * 0.01)
            Shell(commandLine, , True)
        Next
    Next
End Sub

How to specify a path to QLMCall.exe

To work properly, Shell function should find QLMCàll.exe at disk. There are several ways to ensure it will be found:

See also
Welcome to LabelMover