contents.gifprev1.gifnext0.gif


SolverSolve

Equivalent to choosing Range Analyze Solver... and choosing the Solve button in the Solver Parameters dialog box. If successful, returns an integer value indicating the condition that caused the Solver to stop, as described below.

Syntax

SolverSolve(UserFinish, ShowRef)

UserFinish is a value 0 or 1, specifying whether to show the standard Solver Results dialog box.

If UserFinish is 1, SolverSolve returns its integer value without displaying anything. Your LotusScript program should decide what action to take (for example, by examining the return value or presenting its own dialog box); it must call SolverFinish in any case to return the worksheet to its proper state.

If UserFinish is 0, Solver displays the standard Solver Results dialog box, allowing the user to keep or discard the final solution values, and optionally produce reports.

ShowRef is either "", or a string representing a LotusScript function to be called instead of displaying the Show Trial Solution dialog box during the solution process. It is used when you want to regain control whenever Solver finds a new intermediate solution value. The function can inspect the current solution values on the worksheet, or take other actions such as saving or charting the intermediate values, as required by your application. It may determine on each call whether Solver should continue or stop.

In you are not using a custom function, ShowRef should be "". To write a custom ShowRef function, you must be familiar with and use certain advanced features of LotusScript. For technical details and examples of the ShowRef function, please visit the 1-2-3 Solver technical support pages and/or the discussion forum on the Frontline Systems World Wide Web site, http://www.frontsys.com.

Remarks

If a Solver problem has not been completely defined, SolverSolve returns -1. Otherwise the Solver "engine" is started, and the problem specifications are passed to it. When the solution process is complete, SolverSolve returns an integer value indicating the stopping condition:

Value Stopping Condition

0 Solver found a solution. All constraints and optimality
conditions are satisfied.

1 Solver has converged to the current solution. All constraints
are satisfied.

2 Solver cannot improve the current solution. All constraints are
satisfied.

3 Stop chosen when the maximum iteration limit was reached.

4 The Set Cell values do not converge.

5 Solver could not find a feasible solution.

6 Solver stopped at user's request.

7 The conditions for Assume Linear Model are not satisfied.

8 The problem is too large for Solver to handle.

9 Solver encountered an error value in a target or constraint
cell.

10 Stop chosen when maximum time limit was reached.

11 There is not enough memory available to solve the problem.

12 Another 1-2-3 instance is using SOLVE123.DLL. Try again later.

13 Error in model. Please verify that all cells and constraints are
valid.

14 Your free trial license to use the Solver has expired.