CalcVendor 1.0
Users' Manual

  1. Introduction

    CalcVendor lets you create a calculator with windows and a button on your browser, where the button calls a function you wrote which gets or sets values in the windows.

    The function can be a arithmetic, a formula or a C-like function with many statements. The variables(windows)' names, units and initial values can be specified. Since the calculator is a HTML file, you can also put it on the web.

    Fill in the blanks on CalcVendor for the title, the variables and the function. Then CalcVendor creates a calculator file and call your browser to run it. On the calculator, each variable appears as a small window with the label for name and unit, and can have the initial value. The function appears below the button.

    While you don't have to know JavaScript in many cases, the function syntax is just that of JavaScript function, with ".value" replaced by "#". You can modify further the calculator file if you know HTML and JavaScript.

    You can specify a shortcut-key for each variable window and the button, to move the keyboard focus easily between variables and to run the button by a key instead of the mouse.

  2. Installation

    1. System Requirements

      • CPU: Intel 80486 or higher

      • OS: Windows 95, Windows NT 4.0 or higher

      • Web Browser: Internet Explorer 5.5, compatible or higher

    2. Trial Version

      CalcVendor is distributed as a compressed file, *.zip. The installation process is simple. Just extract all of the files contained in it into a folder and run the installer(Install.exe).

      In the second box in the installer, be sure not to choose the product folder but the parent folder! For example, choose "C:\Program Files" if you want CalcVendor to be installed in "C:\Program Files\CalcVendor". If you are a new user, the product folder does not exist and the installer will create it.

      A new user, you now has the trial license. That is, there are restrictions on some features, before you acquire and install a Setup-License key.

    3. Setup-License

      To remove the restriction, you need a Setup-License. Use [Help]->[License] menu, to see the "Setup-ID", generated during the installation. As described in the dialog box, copy and submit (paste) it at http://www.softbattery.net/CalcVendor to acquire (purchase) the corresponding Setup-License key. Enter the key in the dialog box and restart the program.

      Note that the license is per one installation. If you install again for any reason (for example, after you format the disk due to the disk problem or due to upgrading the disk or OS), the Setup-ID will be different so that you need (purchase) a new license.

  3. Getting Started

    Let's see a calculator already made by CalcVendor, in the "example" sub-folder under the folder where CalcVendor is installed. Use the [File]->[Select Launch] menu, for CalcVendor to make your browser run "calc1.htm" as shown below.

    This example is calculating v = i * r, the voltage from the current and the resistance. By pressing the button you will see the voltage value "7" appear. Test other current or resistance values.

    As you can recognize by this example, a calculator consists of variables (there are 3 variables in this example) and a button to run the function. The text in the window below the button shows the function, and the next black-font text below it shows the script used to create the variables' windows.

    The 2 texts are not indispensible for the calculator to run, because the function and the script are already translated into the codes (HTML and JavaScript) that the browser needs to run the calculator. In other words, the calculator file has both of codes and sources, the browser using the former to make the calculator upto the button and the latter just to show.

    Then, what are the 2 sources for? The function is somewhat needed for you to see when using the calculator, since you want to know what you are computing. Furthermore the 2 sources are indispensible for you to modify the calculator, because CalcVendor saves the sources nowhere else than in the calculator file. Now, let's copy the sources from the browser and paste into CalcVendor as shown below, to modify and create a new calculator.

    There are 3 windows in CalcVendor. The first is to specify the calculator's title which will appear above the variable windows as well as on the browser's title bar . Enter a new title "Example 2" for example. The other 2 windows should have the sources for the function and the variables, which are also to be duplicated in the calculator(browser). Copy the sources form the browser into these window. Let's modify them ("kOhm" into "Ohm" and "mA" into "A" for example), and create a new calculator as follows.

    If you press the "Create the calculator and Launch it" button or the [File]->[Create Launch] menu, the new one will be saved into the same file. Let's press the [File]->[Create Launch As..] menu to save into a new file, "calc2.htm" for example. Test the new calculator launched. If you modified a variable's name into a longer one (v into voltage for example) without the Setup-License, the calculator will not work: Refer to the chapter Limits of Trial Version.

    One of the two save(create)-menus gives you a dialog box to specify a new file path and name, while the other does not, as described above. Then you may think there should be a launch(without saving)-menu which does not ask the path and name, while the [File]->[Select Launch] menu does. You are right: It is the [File]->[Launch] menu. The path and name, as well as CalcVendor's main window size and position are memorized into a special file "conf" (in the folder where CalcVendor is installed) when CalcVendor is terminated, to be used when CalcVendor running again.

    The {File]->[New] menu resets (erases) the file path and name, so that even the [File]->[Launch] and the [File]->[Create Launch] menus issue a dialog box to specify the path and name. The {File]->[New] menu also makes the 3 windows empty, just because you may want them empty when you use the menu.

    How to modify the calculator's title instead of typing the new title? Just copy from the browser and modify, like we modified the function and the variables' script. If you know HTML or JavaScript, you may open the calculator file (*.htm) by your text editor to further modify the calculator (to change the title's font size, for example).

  4. Variables and Function

    The syntaxes are described in this chapter, but are so simple that you might already learn them by the examples shown in the previous chapter.

    1. Variables

      Variables are specified in the bottom window of CalcVendor and reproduced at the bottom in the calculator. The window also can specify the button text. Try adding "?&Compute(C)" as the final line, the meaning of which will be described in this section. The final line specifies the button's name and the other lines are for variables. Without the button's line, the button will read "Calculate".

      The line for each variable consists of the name, the unit and the initial value. They are partitioned by "/". If you don't need the initial value, you write the line "v/V" for example. If you need it but don't need the unit, you write the line "v//4.1" for example. If you need the name only, you write the line "v" for example.

      You can not be confused between the terms "the variables window" and "a variable('s) window" if you have read this manual upto this far. The former contains the source or script specifying the variables and the button, the syntax of which is described in paragraphs above and below in this section. The latter is a variable's user interface on the calculator (like the first window for the variable named "v" on the example calculator in the previous chapter), created according to the source.

      We can move the keyboard focus to a variable window, by a shortcut key. Write "&i" instead of "i" in the source, for example. Then "i" in the label of the variable window will be underlined and Alt+I moves the focus to the window. (If you installed the Setup-License to use long variable names, "c&urrent" in the source will make "u" underlined and give you shortcut Alt+U. for example.)

      But the underlining does not work for the button. If you want to assign the key Alt+C for the button and want to show it, you may write "?&Compute(C)" for example. Note that a key for the button is not to get the focus, but to run it (equivalent to clicking it).

      As shown above, "?" should start the line for the button and the other part of the line specifies the button's name. Therefore a variable name should not start with "?". We end this section by noting that the button name and the variables' units does not matter with how the calculator works, while the variables' names does matter: Only variables' names ("&" ignored if included for shortcut) will be used in the function, to represent their values, as described in the next section.

    2. Function

      Function is specified in the window above the variables' window in CalcVendor and reproduced in the corresponding window in the browser. As you saw in the examples, a variable named "v" enters in the function as "v#" for example.

      Although only the arithmetic operator "*" was used in the example, other operators "/", "+", "-" and so on can be used, as far as are defined in JavaScript. The basic syntax of JavaScript is similar to that of C, as far as you use those operators or flow control statements (if, else, switch, ...). If you know JavaScript and see a calculator file (*.htm) by text editor, you can find that CalcVendor just translates "#" into ".value" in the function.

      Knowing that sin() in C is Math.sin() in JavaScript for example is enough for us not to need learn JavaScript, in many cases. If you know enough about JavaScript, you can write various functions beyond just calculation.

      Launch the calculator file "calc3.htm" to see a calculator as shown above, where the function is not just a formula but has several statements, and where is shown JavaScript string manipulations more convenient than that of C. In this example, the variable "s" selects one of the two resistors, and any string other than "r" or "p" on it lets the button make us see an error message instead of a voltage on the variable "v".

      Also demonstrated in this example are, commenting by "//" like in C, and using a local variable (named "message" here) simpler than C: As well as global variables that the CalcVender translates by "#", local variables don't need type declarations, in JavaScript.

  5. Limits of Trial Version

    The following paragraphs list the trial version's limits. They will disappear if you install a Setup-License: Refer to the section Setup-License

    Every variable's name should be one character, i.e. should have length 1 (not counting "&"). If a name is longer than one character, CalcVendor use only the first character as the name when it writes the function codes into the calculator file (*.htm) so that the calculator's function button does not work since the name differs from that of the allocated variable('s window).

    The trial version also has a small additional area in the main window to display advertising pictures. If the computer is connected to the internet, new pictures may be displayed.

  6. License Agreement

    Please read Agree.txt.