|
Sample ScriptsEXCEL_CALCULATE (VB stack function)This sample illustrates how to use objects available on your system. In particular how you can use existing excel worksheets and integrate them in your exchange logic. Suppose you have a worksheet that calculates prices of articles for you based on the ordered quantity. Like our wine sample below. Basically in this sheet you have your articles listed in the D-column, and in the E to H column you specify the price depending on the quantity range. By entering an article in cell A2, and a quantity in B2 the sheet gives you the price in cell A4. This is because cell A4 has the instruction VLOOKUP($A$2;D2:H10;$B$2/5+2;FALSE). Integrating this in your PRODBX script means you need to provide 2 values to the sheet. One will go directly as InputValue, the other through the Stack (value written to the stack by a previously interpreted field). Once this is done the script will return the result of the sheet. When calling the function we pass 3 parameters:
Function ExcelCalculate(InputValue,Stack,Parameter1,Parameter2,Parameter3,Parameter4) Results in: |
|||||||||||||||||||||||
PROMES BVBA - Laarsebeekdreef 14 2900 Schoten Belgium Tel: +32 475 87 69 38 - E-mail: info@promes.be |
||||||||||||||||||||||||