![]()
Tag/API Code Editor
The Tag/API Code Editor dialog is a primary component of WildEdit. It allows the quick and easy manipulation of commonly used source code functions, subroutines and HTML strings. The Tag/API Code Editor can only handle (edit) functions, subroutines and HTML strings that are defined in the loaded Tag/Api Configuration file, which is user definable. See Tag/Api Config Editor for more information on defining Tag/Api calls.
Below is a screen shot if the Tag/API Code Editor with a HTML Tag of "<input>" selected. This tag is defined in the loaded Tag/Api Config file (see App Setup) and has an associated API call of "htmFormInputStr." The Tag/API Code Editor is invoke from the source code window with the F5 key, or by selecting a recognized API call and right clicking in the code editor window, then selecting Edit Selected Block.
The screen shot below prepares a htmFormInputStr function for insertion into the current source code window. Edit each parameter of the API call by double clicking the parameter, entering the parameter value and set its value type. The "Output As" windows show me what the finished function will look like once inserted into my source code. Click OK to accept the values and insert the function. You can also choose how the output should be formatted. See "Output As" below.
Remember you can also highlight (select) an existing function in the main code editor window and hit F5 to edit the function in the Tag/API Code Editor. See Code Editor for details.
Another example: let's say you have a wcCode LIB program that you always use with each of your projects, because it has your commonly used string manipulation routines. If one of you routines is:
function MyPadString(existingStr as string, padChar as string, padAmount as integer, padLeft as boolean) as string
then you could add this function to the default Tag/API Config file (weTags.htc). Once you have added this function to the Tag/API Config file, you could then quickly add the function to your source code during your coding session by hitting F5 to invoke the Tag/API Code Editor, select MyPadString from the Tag/Api: dropdown list, fill in your parameters, then hit OK to insert the function into your code.

| Window Item | Action/Explanation |
| Tag/Api dropdown list | This drop list allows you to choose the type of HTML Tag or API call you wish to insert into your source code. This list is defined by the loaded HTC file (see App Setup). You can define the HTC files with the Tag/API Config Editor. |
| Property Editor button | The Property Editor button is visible only when a HTML Tag or API call type is selected that has its own propert editor. Tag/Api items that currently have a property editor: <input>, <img> and <font>. |
| OK button | Clicking OK accepts the current values and inserts the Output As string into your source code at the current caret position. If text was selected before invoking the html Code Editor dialog, then that text will be replaced with the Output As string. |
| Cancel button | Clicking Cancel quits the Tag/API Code Editor dialog without changing or inserting any code. |
| Parameter | The Parameter column displays the
parameters you can edit for the selected Tag/Api type. The little icon next to the
parameters describes the parameter's state or type: <v>=source code variable, function or subroutine (non-string) type <s>=source code string type <h>=html type Double click a parameter to edit its value and type. |
| Value | The Value column displays the parameter's current value setting. To change a parameter's value double click the parameter name. The Parameter Editor dialog will be invoked, allowing you to change the value. See Parameter Editor below. |
| Type | The Type column displays the parameter's value type: either string type or non-string type. The difference is: a string type will be output with enclosing quote marks. |
| Output As | The Output As radio buttons allow you to select the type output string. Typically you will use API call. |
| Output As code window | The Output As window shows you what the output will look like. |
Note: changing the Tag/Api type clears the current parameter settings.
Parameter Editor dialog
A unique operation of the Tag/API Code Editor is that you can nest Tag/API parameter values. This means you can set the value of a parameter to another Tag or API function by clicking the HTML button in the Parameter Editor dialog. For example: a function like:
htmLink("/mydomain.com", htmFontStr("Click Here", "Arial", "#000000", 2, 0))
as a nested API call of htmFontStr. The htmLink function has 2 parameters, the actual html link is the first parameter, and the text that is displayed on the page is the second parameter. This second parameter was set by clicking the HTML button on the Parameter Editor dialog and setting another Tag/API function to <font>.
Note you can have more than 2 nested functions. I have tested upto 10 nested functions. The limit I have come across is the length of the resulting string. It seems that if the string is longer than 1200 characters, then the string gets cut off at 1200 characters.

| Window Item | Action/Explanation |
| Window Caption | The window's caption displays which parameter is being edited. |
| Parameter Value is a source... | The Parameter Value is... checkbox toggles the string type of the parameter value. If checked then the value is of type non-string, like a source code function, subroutine or variable expression. If unchecked then the value is of type string and will be enclosed in quote marks on output. |
| Value edit box | This is where you type/edit the parameter's value. |
| HTML button | The HTML button invokes another Tag/API Code Editor dialog, allowing you to quickly and easily set the parameter's value to another Tag/Api type. |
| Use Parameter button | Use this button when outputting a string as Raw HTML. Many HTML tags have parameters that have no value; for example the NOWRAP parameter of a table cell (<td>). Clicking the User Parameter button places a "!" (bang) in the Value edit box; this tells the HTML Code Editor to use this parameter with no value setting. |
| Clear button | Clears the Value edit box. |
| Color button | Invokes the color dialog. If you accept a color in the color dialog the color is converted to a HTML color code string. Use this button when setting color parameter values. |
| OK button | Accepts the changes and applies them to the Tag/API Code Editor. |
| Cancel button | Cancels you changes and does not affect the Tag/API Code Editor. |
Below is another example of the Tag/API Code Editor, but with an API tag type selected. Note that this example has a nested API Call. The htmFontStr is nested inside the htmDisplayMsgLink API call. To edit the htmFontStr API call with the Tag/API Code Editor, double click the "message" parameter to invoke the Parameter Editor dialog, then click the HTML button.

Note that the Tag/Api type is a function or sub call and not a HTML tag. The Tag/API Code Editor can be used for editing both HTML tags and source code function and subroutine calls. If the Tag/Api type is not a HTML tag, then the Output As radio buttons are all disabled except for API Call. To add your own functions, subroutines and HTML Tags to the Tag/Api type list use the Tag/Api Config Editor.