datasourceconnectionsinmistudio
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| datasourceconnectionsinmistudio [2024/02/23 14:16] – [Debugging JavaScript] amyw | datasourceconnectionsinmistudio [2024/02/23 16:50] (current) – [Debugging JavaScript] amyw | ||
|---|---|---|---|
| Line 195: | Line 195: | ||
| If the connection line is red, select the connection and look at the description line at the bottom of the Diagram Window to get some information about the problem. | If the connection line is red, select the connection and look at the description line at the bottom of the Diagram Window to get some information about the problem. | ||
| - | ==Syntax Errors== | + | **Syntax Errors** |
| - | ==Execution Errors | + | |
| - | ==TypeError: Cannot convert null to an object== | + | The script is interpreted in two passes. The first pass checks the syntax of the program lines (does not try to evaluate any statements). In this pass, the script will stop immediately if there is an error and produce an error line that has " |
| - | ==TypeError: undefined is not a function== | + | |
| - | ==ReferenceError: | + | You have to go to the 35th line in the JavaScript code and find that you forgot to enclose a boolean condition statement with parentheses. Sometimes it is easier to find the nth line in the code by copying the JavaScript into a text editor that will display line numbers. |
| - | ==ReferenceError: | + | |
| + | Another common syntax error is forgetting a quote on a String. If you see | ||
| + | < | ||
| + | look on line 12 of the script and make sure you have quotes around the string in the line. For example, | ||
| + | |||
| + | < | ||
| + | |||
| + | **Execution Errors** | ||
| + | |||
| + | Once the interpreter gets past the syntax check, it will try to execute the code, top down. Functions are not evaluated until called. Typical errors at this stage do not tell you any line numbers. Here are some examples and causes. | ||
| + | |||
| + | |||
| + | **TypeError: Cannot convert null to an object** | ||
| + | |||
| + | < | ||
| + | |||
| + | When you get a " | ||
| + | |||
| + | 1. Referencing graphical objects | ||
| + | |||
| + | < | ||
| + | |||
| + | This will cause an error because " | ||
| + | |||
| + | 2. Referencing beans that do not exist (wrong name) | ||
| + | |||
| + | < | ||
| + | |||
| + | if there is no logic component named " | ||
| + | |||
| + | |||
| + | **TypeError: undefined is not a function** | ||
| + | |||
| + | This error will say | ||
| + | |||
| + | < | ||
| + | |||
| + | This will happen if you are calling a server method such as < | ||
| + | |||
| + | < | ||
| + | Ivo = IncrementServer-> | ||
| + | test = lvo.getLength(); | ||
| + | </ | ||
| + | |||
| + | because getLength() does not exist as a method for a Value Object. | ||
| + | |||
| + | Unfortunately for this error there is no indication of what the faulty method name is so you have to study your JavaScript carefully to see the problem. | ||
| + | |||
| + | **ReferenceError: | ||
| + | |||
| + | If you reference a variable that does exit you will get an | ||
| + | < | ||
| + | |||
| + | For example, if your code says: | ||
| + | |||
| + | < | ||
| + | vo = new StringValueObject(stateString); | ||
| + | </ | ||
| + | |||
| + | and the variable " | ||
| + | < | ||
| + | |||
| + | | ||
| + | < | ||
| + | stateString | ||
| + | </ | ||
| + | |||
| + | or | ||
| + | |||
| + | < | ||
| + | stateString | ||
| + | </ | ||
| + | |||
| + | **ReferenceError: | ||
| + | |||
| + | This error is caused by referencing a defined function called " | ||
| + | |||
| + | |||
| + | ((**A DataSourceConnections.frx file is attached for you to download and add to your applications directory. You could open the DataSourceConnections application to see the examples. The Design Window has descriptions and the Diagram window is the place to see all the connections and data flows.** | ||
| + | )) | ||
datasourceconnectionsinmistudio.1708715780.txt.gz · Last modified: by amyw
