Before you can execute a script, you must compile it.
To compile a script:
-
Click the Compile button, or select Edit>Compile from the menu bar.
PowerBuilder compiles the script and reports any problems it finds, as described in Handling problems.
PowerBuilder compiles automatically
When you attempt to open a different script in a Script editor, PowerBuilder compiles the current script. When you save the object, such as the window containing a control you wrote a script for, PowerBuilder recompiles all scripts in the object to make sure they are still valid. For example, PowerBuilder checks that all objects that were referenced when you wrote the script still exist.
If problems occur when a script is compiled, PowerBuilder displays messages in the Output window (in the solution) or a Message window below the script (in the workspace).
There are three kinds of messages:
-
Errors
-
Warnings
-
Information messages
Understanding errors
Errors indicate serious problems that you must fix before a script will compile. Errors are shown in the Message window as:
line number, column number: Error error number:message
In the workspace format, you will have to fix the error before you can close the Script editor or open another script in the same view.
Understanding warnings
Warnings indicate problems that you should be aware of but that do not prevent a script from compiling.
There are three kinds of warnings.
Compiler warnings. Compiler warnings inform you of syntactic problems, such as undeclared variables. PowerBuilder lets you compile a script that contains compiler warnings. Compiler warnings are shown in the Message window as:
line number, column number: Warning warning number:message
Obsolete warnings. Obsolete warnings inform you when you use any obsolete functions or syntax in your script. Obsolete functions, although they still compile and run, have been replaced by more efficient functions and will be discontinued in a future release of PowerBuilder. You should replace all references to obsolete functions as soon as possible. Obsolete warnings are shown in the Message window as:
line number, column number: Warning warning number:message
Database warnings. Database warnings come from the database manager you are connected to. PowerBuilder connects to the database manager when you compile a script containing embedded SQL. Typically, these warnings arise because you are referencing a database you are not connected to. Database warnings are shown in the Message window as:
line number, column number: Database warning number:message
PowerBuilder lets you compile scripts with database warnings and also lets you save the associated object. It does this because it does not know whether the problem will apply during execution, since the execution environment might be different from the compile-time environment.
You should study database warnings carefully to make sure the problems will not occur at runtime.
Understanding information messages
Information messages are issued when there is a potential problem. For example, an information message is issued when you have used a global variable name as a local variable, because that might result in a conflict later.
Information messages are shown in the Message window as:
line number, column number: Information number:message
Displaying warnings and messages
To specify which messages display when you compile, select Design>Options to open the Options dialog box, select the Script tab page, and check or clear the Display Compiler Warnings, Display Obsolete Messages, Display Information Messages, and Display Database Warnings check boxes. The default is to display compiler and database warning messages. Error messages always display.
Fixing problems
To fix a problem, click the message. The Script editor scrolls to display the statement that triggered the message. After you fix all the problems, compile the script again.
To save a script with errors
In the solution format, you can save a script even if there are compilation errors.
In the workspace format, you will have to comment out the lines containing errors before you can save the script.
Disabling database connection when compiling and building
When PowerBuilder compiles an application that contains embedded SQL, it connects to the database profile last used in order to check for database access errors during the build process. However,
-
For applications that use multiple databases, this can result in spurious warnings during the build since the embedded SQL can be validated only against that single last-used database and not against the databases actually used by the application. In addition, an unattended build, such as a lengthy overnight rebuild, can stall if the database connection cannot be made.
-
For applications running in the solution format, database connection may pop up multiple times during the build because the solution and compiler supports multi-threading and concurrent processing.
To avoid these issues, you can select the "Disable Database Connection When Compiling and Building" check box on the General page of the System Options dialog box.
Caution
Select the check box only when you want to compile without signing on to the database. Compiling without connecting to a database prevents the build process from checking for database errors and may therefore result in runtime errors later.
- C0001 Compiler Error
- C0002 Compiler Error
- C0003 Compiler Error
- C0004 Compiler Error
- C0005 Compiler Error
- C0006 Compiler Warning
- C0007 Compiler Error
- C0008 Compiler Error
- C0009 Compiler Error
- C0010 Compiler Error
- C0011 Compiler Error
- C0013 Compiler Error
- C0014 Compiler Warning
- C0015 Compiler Error
- C0016 Compiler Error
- C0017 Compiler Error
- C0018 Compiler Error
- C0019 Compiler Error
- C0020 Compiler Error
- C0021 Compiler Error
- C0022 Fatal Compiler Error
- C0023 Compiler Error
- C0024 Compiler Error
- C0025 Compiler Error
- C0026 Compiler Error
- C0027 Compiler Error
- C0028 Compiler Error
- C0029 Compiler Error
- C0030 Fatal Compiler Error
- C0031 Compiler Error
- C0032 Fatal Compiler Error
- C0033 Compiler Error
- C0034 Compiler Error
- C0035 Compiler Error
- C0036 Compiler Error
- C0037 Compiler Error
- C0038 Database Error
- C0039 Compiler Error
- C0040 Compiler Error
- C0041 Compiler Error
- C0042 Compiler Error
- C0043 Compiler Error
- C0044 Compiler Error
- C0045 Compiler Error
- C0046 Compiler Error
- C0047 Compiler Error
- C0048 Compiler Error
- C0049 Compiler Error
- C0050 Compiler Error
- C0051 Compiler Error
- C0052 Compiler Error
- C0053 Compiler Error
- C0054 Database Error
- C0055 Compiler Error
- C0056 Compiler Error
- C0057 Compiler Error
- C0058 Compiler Warning
- C0059 Compiler Warning
- C0060 Compiler Error
- C0061 Compiler Error
- C0062 Compiler Error
- C0063 Compiler Error
- C0064 Compiler Error
- C0065 Compiler Error
- C0066 Compiler Error
- C0067 Compiler Error
- C0068 Compiler Error
- C0069 Compiler Error
- C0070 Compiler Error
- C0071 Compiler Error
- C0072 Compiler Error
- C0073 Compiler Warning
- C0074 Compiler Error
- C0075 Compiler Warning
- C0076 Compiler Error
- C0077 Compiler Error
- C0078 Compiler Error
- C0079 Compiler Error
- C0080 Compiler Error
- C0081 Compiler Error
- C0082 Compiler Error
- C0083 Compiler Error
- C0084 Compiler Error
- C0085 Compiler Error
- C0086 Compiler Warning
- C0087 Compiler Warning
- C0088 Compiler Warning
- C0089 Compiler Warning
- C0090 Compiler Error
- C0091 Compiler Error
- C0092 Compiler Error
- C0093 Compiler Error
- C0094 Compiler Error
- C0095 Compiler Error
- C0096 Compiler Error
- C0097 Compiler Error
- C0098 Compiler Error
- C0099 Compiler Warning
- C0100 Compiler Error
- C0101 Compiler Error
- C0102 Compiler Error
- C0103 Compiler Error
- C0104 Compiler Error
- C0105 Compiler Error
- C0106 Compiler Error
- C0107 Compiler Error
- C0108 Compiler Error
- C0109 Compiler Error
- C0110 Compiler Warning
- C0111 Compiler Error
- C0112 Compiler Error
- C0113 Compiler Error
- C0114 Compiler Error
- C0115 Compiler Error
- C0116 Compiler Error
- C0117 Compiler Error
- C0118 Compiler Error
- C0119 Compiler Error
- C0120 Compiler Error
- C0121 Compiler Error
- C0122 Compiler Error
- C0123 Compiler Error
- C0124 Compiler Error
- C0125 Compiler Error
- C0126 Compiler Error
- C0127 Compiler Error
- C0128 Compiler Error
- C0129 Compiler Warning
- C0130 Compiler Error
- C0131 Compiler Error
- C0132 Compiler Error
- C0133 Compiler Error
- C0134 Compiler Error
- C0135 Compiler Error
- C0136 Compiler Error
- C0137 Compiler Error
- C0138 Compiler Error
- C0139 Compiler Error
- C0140 Compiler Error
- C0141 Compiler Error
- C0142 Compiler Error
- C0143 Compiler Error
- C0144 Compiler Error
- C0145 Compiler Error
- C0146 Informational Message
- C0147 Informational Message
- C0148 Informational Message
- C0149 Informational Message
- C0150 Compiler Warning
- C0151 Compiler Warning
- C0152 Compiler Error
- C0153 Compiler Error
- C0154 Compiler Error
- C0155 Compiler Error
- C0156 Compiler Warning
- C0157 Informational Message
- C0158 Compiler Error
- C0159 Compiler Error
- C0160 Compiler Error
- C0161 Compiler Error
- C0162 Compiler Error
- C0163 Compiler Error
- C0164 Compiler Error
- C0165 Compiler Error
- C0166 Compiler Error
- C0167 Compiler Error
- C0168 Informational Message
- C0169 Compiler Error
- C0170 Compiler Error
- C0171 Compiler Warning
- C0172 Compiler Error
- C0173 Compiler Error
- C0174 Compiler Error
- C0175 Compiler Error
- C0176 Compiler Error
- C0177 Compiler Error
- C0178 Compiler Warning
- C0179 Compiler Warning
- C0180 Compiler Error
- C0181 Compiler Error
- C0182 Compiler Error
- C0183 Compiler Error
- C0184 Compiler Error
- C0185 Obsolete Warning
- C0186 Compiler Warning
- C0187 Compiler Error
- C0188 Compiler Warning
- C0189 Compiler Error
- C0190 Compiler Warning
- C0191 Compiler Error
- C0192 Compiler Error
- C0193 Compiler Error
- C0194 Compiler Error
- C0195 Compiler Error
- C0196 Compiler Error
- C0197 Informational Message
- C0198 Compiler Warning
- C0199 Compiler Warning
- C0200 Compiler Error
- C0201 Compiler Error
- C0202 Compiler Error
- C0203 Compiler Error
- C0204 Compiler Error
- C0205 Migration Warning
- C0206 Migration Warning
- C0207 Migration Warning
- C0208 Informational Message
- C0209 Compiler Warning
- C0210 Compiler Warning
- C0212 Compiler Error
- C0213 Compiler Error
- C0214 Compiler Error
- C0215 Compiler Error
- C0216 Compiler Error
- C0217 Informational Message
- C0218 Compiler Warning
- C0300 Compiler Error
- C0301 Compiler Error
- C0302 Compiler Error
- C0303 Compiler Error
- C0304 Compiler Error
- C0305 Compiler Error
- C0306 Compiler Error
- C0307 Compiler Error
- C0308 Compiler Error
- C0309 Compiler Error
- C0310 Compiler Error
- C0311 Compiler Error
- C0312 Compiler Error
- C0313 Compiler Error
- C0314 Compiler Warning
- C0315 Compiler Warning
- C0316 Compiler Error
- C0317 Compiler Warning
- C0318 Compiler Warning
- C0319 Compiler Error
- C0320 Compiler Error
- C0321 Compiler Error
- C0322 Compiler Error
- C0323 Compiler Warning
- C0324 Compiler Warning
- C0325 Compiler Error
- C0326 Compiler Error
- C0327 Compiler Error
- C0328 Compiler Error
- C0329 Compiler Error
- C0330 Compiler Error
- C0331 Compiler Error
Message text
Illegal datatype: type.
Explanation
The following statement generates Error C0001: Illegal datatype indt:
indt li_num
A variable can be a standard datatype, a structure, or an object. Object datatypes can be system objects as displayed in the Browser or they can be objects you have defined by deriving them from those system object types.
See Also
Declaring Variables in the section called “Declaring variables” in PowerScript Reference.
Message text
Array subscript is not an integer.
Explanation
The following code generates C0002:
char lc_char='a' int li_array[2] li_array[lc_char]=1 //generates error C0002 Boolean lb_bool=false int li_array2[2] li_array2[lb_bool]=1 //generates error C0002
Array subscripts must be integers. The following code compiles without error:
char lc_char='a' char li_array[2] li_array[1]=lc_char Boolean lb_bool=false boolean li_array2[2] li_array2[1]=lb_bool
See Also
Declaring arrays in the section called “Declaring arrays” in PowerScript Reference.
Message text
Condition for if statement must be a boolean.
Explanation
The following code generates C0003:
int li_num if li_num then // generates C0003 li_num++ end if
The following code compiles without error:
int li_num if li_num < 100 then li_num++ end if
See Also
IF...THEN in the section called “IF...THEN” in PowerScript Reference.
Message text
Condition for elseif statement must be a boolean.
Explanation
The following code generates C0004:
boolean lb_cond int li_num char lc_charc if lb_cond then li_num++ elseif lc_charc then // generates C0004 li_num -- // note space required before -- end if
The following code compiles without error:
boolean lb_cond int li_num char lc_charc if lb_cond then li_num++ elseif lc_charc = 'Z' then li_num -- end if
See Also
IF...THEN in the section called “IF...THEN” in PowerScript Reference.
Message text
Condition for do loop must be a boolean.
Explanation
The following code generates C0005:
boolean lb_cond int li_a=1,li_b DO UNTIL li_b // generates C0005 li_a++ LOOP DO WHILE li_b // generates C0005 li_a++ LOOP
The following code compiles without error:
boolean lb_cond int li_a=1,li_b DO UNTIL li_a = 100 li_a++ LOOP DO WHILE lb_cond li_a++ LOOP
See Also
DO...LOOP in the section called “DO...LOOP” in PowerScript Reference.
Message text
Unused label: label.
Explanation
The following code generates C0006:
int li_b nextline: li_b=3 //generates C0006 li_b=3
The following code compiles without error:
int li_b goto nextline nextline: li_b=3 li_b=3
See Also
GOTO in the section called “GOTO” in PowerScript Reference.
Message text
No label for goto: string.
Explanation
The following code generates C0007:
int li_num=123 goto start // generates C0007 goto nextline nextline: li_num++
See Also
GOTO in the section called “GOTO” in PowerScript Reference.
Message text
Incompatible types in assignment: type1, type2.
Explanation
The following code generates C0008:
int li_num li_num = "string" // generates C0008: Incompatible // types in assignment: integer, string
See Also
Assignment in the section called “Assignment” in PowerScript Reference.
Message text
Nested array list expressions are illegal.
Explanation
The following code generates C0010:
int li_a[3]={{1,2},3} // generates C00010
See Also
Using arraylists to assign values to an array in the section called “Using arraylists to assign values to an array” in PowerScript Reference.
Message text
Incompatible types in expression: type1, type2.
Explanation
The following code generates C00011:
int li_a string ls_b // Each of the following statements generates C00011: // Incompatible types in expression: integer, string ls_b = li_a + ls_b ls_b = li_a * ls_b ls_b = li_a - ls_b ls_b = li_a / ls_b
See Also
Datatype of PowerBuilder expressions in the section called “Datatype of PowerBuilder expressions” in PowerScript Reference.
Message text
Incompatible types in boolean expression: type1, type2.
Explanation
The following code generates C00013:
char lc_ch int li_n do while lc_ch and li_n // generates C0013: Incompatible // types in boolean expression: // character, integer ... loop
See Also
Datatype of PowerBuilder expressions in the section called “Datatype of PowerBuilder expressions” in PowerScript Reference.
Message text
Undefined variable: variable.
Explanation
The following code generates C00014:
num=10 // generates C0014: Undefined variable: num char lc_ch lc_ch = achar // generates C0014: // Undefined variable: achar
See Also
Declaring Variables in the section called “Declaring variables” in PowerScript Reference.
Message text
Undefined variable: variable.
Explanation
The following code generates C00015 when the global variables gi_var and gc_var have not been defined:
int li_a=::gi_var char lc_ch=::gc_var
See Also
Declaring Variables in the section called “Declaring variables” in PowerScript Reference.
Message text
Incompatible type in expression: type.
Explanation
The following code generates C00016:
char lc_a int num= - lc_a // generates C0016: Incompatible type // in expression: character
See Also
Datatype of PowerBuilder expressions in the section called “Datatype of PowerBuilder expressions” in PowerScript Reference.
Message text
Incompatible type for NOT operator: type.
Explanation
The following code generates C00017:
int li_a int li_b if not li_b then // generates C00017: Incompatible type // for NOT operator: integer li_a ++ end if
The following code compiles without error:
int li_a boolean bstatus if not bstatus then li_a ++ end if
See Also
Relational operators in PowerBuilder in the section called “Relational operators in PowerBuilder” in PowerScript Reference.
Message text
Incompatible property property for type type.
Explanation
Error C0019 is generated when you try to access a property that does not exist. The window w_compiler has an instance variable, integer xyz, but it does not have an instance variable named abc. The last line in this code in the open event of the window generates C00019: Incompatible property abc for type w_compiler:
integer li_num li_num = w_compiler.xyz // compiles without error li_num = w_compiler.abc // generates C0019
Message text
Function with no return value used in expression.
Explanation
In a custom class user object, two functions are defined. Function f1 has no return value. The following script in function f2 generates C0020:
int li_num li_num=1+f1() //generates C0020
Message text
Global variables must be declared outside a routine.
Explanation
In a custom class user object, a function f1 is defined. The following statement in function f1 generates C0021:
global char lc_ch //generates C0021
The global variable char lc_ch should be defined on the Declare Global Variables tab in the Script editor.
See Also
Where to declare variables in the section called “Where to declare variables” in PowerScript Reference.
Message text
Script is too large: divide script into multiple events or functions.
Message text
Cannot mix valued enumerated properties with non-valued enumerated properties.
Message text
Illegal datatype for parent: type.
Explanation
The following source code for a custom class user object generates C0025:
forward global type my_nvo from nonvisualobject end type end forward global type my_nvo from my_nvo //generates C0025 end type global my_nvo my_nvo
Message text
Cannot inherit from enumerated type: type.
Explanation
The following source code for a custom class user object generates C0026:
forward global type my_nvo from nonvisualobject end type end forward global type my_nvo from border //generates C0026 end type global my_nvo my_nvo
Message text
Error string generated by the DBMS.
Explanation
This string is generated by the database management system to which you are connected. For example, if you are using the PowerBuilder Desktop edition and you attempt to use a SQL Anywhere stored procedure, you see the following error message:
Database C0038: The PowerBuilder Desktop edition does not support stored procedures.
Message text
Cursor/Procedure (procedure) has not been declared.
Explanation
The following script in a function generates C0039 because the cursors li_a and abc have not been declared:
int li_a DECLARE curs CURSOR FOR SELECT employee.emp_id FROM employee WHERE employee.salary > 1000; OPEN curs; // compiles OPEN li_a; // generates C0039 OPEN abc; // generates C0039
The following script in a function generates C0039 because the procedures li_a and abc have not been declared:
int li_a DECLARE proc PROCEDURE FOR procname; EXECUTE proc; // compiles EXECUTE li_a; // generates C0039 EXECUTE abc; // generates C0039
Message text
Database command must reference transaction object.
Explanation
The following script in a function generates C0043 because the cursor curs and procedure proc do not reference transaction objects:
int li_a = 1 transaction trans transaction trans_arr[5] CONNECT USING sqlca; // ok - default transaction COMMIT USING trans; // ok - declared transaction DECLARE curs CURSOR FOR SELECT employee.emp_id INTO :li_a FROM employee WHERE employee.salary > 1000 USING li_a; // error - integer, not transaction DECLARE proc PROCEDURE FOR procname USING trans_arr; // error - array DELETE FROM employee WHERE emp_id<200 USING trans_arr[1]; // ok - array element
See Also
Using SQL in scripts in the section called “Using SQL in scripts” in PowerScript Reference.
Message text
Variable reference in database statement has unsupported datatype.
Explanation
The following script in a function in the custom class user object n_nvo generates C0044 because the integer array and nonvisualobject datatypes are not supported:
int idnum = 0 // ok int int_arr[] // error char char_arr[] // ok n_nvo n // error int minsalary = 1000 SELECT employee.emp_id INTO :idnum, :int_arr, :char_arr, :n // generates C0044 FROM employee WHERE employee.salary > :minsalary;
See Also
Using SQL in scripts in the section called “Using SQL in scripts” in PowerScript Reference.
Message text
Indicator variable reference in database statement must be an integer.
Explanation
The following script in a function in the custom class user object n_nvo generates C0045 because the integer array and nonvisualobject datatypes are not supported:
int idnum = 0 char char_arr[] int li_ind //ok char lc_ind //error int minsalary = 1000 SELECT employee.emp_id INTO :idnum :li_ind, :char_arr :lc_ind FROM employee WHERE employee.salary > :minsalary;
See Also
Using SQL in scripts in the section called “Using SQL in scripts” in PowerScript Reference.
Message text
Illegal datatype for within clause: type.
Explanation
If you edit the source of a window, you will notice "within" clauses
like the following: type cb_1 from commandbutton within
w_1
. Changing the object referenced in the within clause can
cause this error.
Message text
Unknown function name: function.
Explanation
The following script in a function in a custom class user object generates C0051 because the function openn() does not exist:
openn() // generates C0051 return 1
Message text
Bad argument list for function: function.
Explanation
Consider two functions defined on a custom class user object. Function f1 takes one integer argument by value. The following script in function f2 generates C0052 because "a" is declared as a char:
char a f1(a) // generates C0052
Message text
Illegal for loop counter variable type: type.
Explanation
You cannot initialize a FOR loop with a non-numeric datatype. The following script generates C0055:
char lc_ch for lc_ch= 1 to 3 // generates C0055: Illegal for loop // counter variable type: character ... next
See Also
FOR...NEXT in the section called “FOR...NEXT” in PowerScript Reference.
Message text
Illegal for loop initializer expression type: type.
Explanation
You cannot use a non-numeric datatype in an expression in a FOR loop. . The following script generates C0056:
char lc_ch = 'a' int li_num for li_num = lc_ch to 3 // generates C0056: Illegal for // loop initializer expression // type: character ... next
See Also
FOR...NEXT in the section called “FOR...NEXT” in PowerScript Reference.
Message text
Illegal for loop terminator expression type: type.
Explanation
You cannot use a non-numeric datatype in an expression in a FOR loop. The following script generates C0057:
char lc_ch = 'a' int li_num for li_num = 1 to lc_ch // generates C0057: Illegal for // loop terminator expression // type: character ... next
See Also
See DO...LOOP and FOR...NEXT in the section called “DO...LOOP” in PowerScript Reference and the section called “FOR...NEXT” in PowerScript Reference.
Message text
Exit statement occurs outside loop construct.
Explanation
Both these functions generate C0058:
// function f1 boolean lb_bool int li_num do while lb_bool li_num++ exit loop exit // generates C0058
// function f2 int li_num for li_num=1 to 4 li_num++ next exit // generates C0058
These functions compile without errors:
// function f1 boolean lb_bool int li_num do while lb_bool li_num++ exit loop
// function f2 int li_num for li_num=1 to 4 li_num++ exit next
See Also
See DO...LOOP and FOR...NEXT in the section called “DO...LOOP” in PowerScript Reference and the section called “FOR...NEXT” in PowerScript Reference.
Message text
Continue statement occurs outside loop construct.
Explanation
This function generates C0059:
int li_num for li_num=1 to 4 li_num++ next continue
This function compiles without errors:
int li_num for li_num=1 to 4 li_num++ continue next
See Also
See DO...LOOP and FOR...NEXT in the section called “DO...LOOP” in PowerScript Reference and the section called “FOR...NEXT” in PowerScript Reference.
Message text
Illegal enumerated constant: constant.
Explanation
This script generates C0059: Illegal enumerated constant: happiness:
border lb_a = box! border lb_b = happiness!
Message text
Current object has no parent.
Explanation
This statement in the open event of a window generates C0061:
parent.width = 1000 // generates C0061
A window has no parent. Its properties can be accessed using the pronoun "this" or using the pronoun "parent" with a control on the window. This statement in the open event of the window compiles without error:
this.width = 1000
This statement in the clicked event of a button on the window produces the same result:
parent.width = 1000
Message text
Invalid operand type for Dot operator: type.
Explanation
These statements generate C0063: Invalid operand type for Dot operator: integer:
int li_a,li_b li_a = li_a.li_b // generates C0063
Message text
Invalid ~ octal character sequence in string.
Explanation
This statement generates C0064. Octals can contain only the digits 0 through 7:
string ls_b = "~o128" // generates C0064
This statement compiles correctly and the string ls_b is set to the uppercase letter W:
string ls_b = "~o127"
See Also
Special ASCII characters in the section called “Special ASCII characters” in PowerScript Reference.
Message text
Invalid ~ hex character sequence in string.
Explanation
This statement generates C0065. Hexadecimals can contain only the digits 0 through 9 and the letters A through F:
string ls_b = "~h4H" // generates C0065
This statement compiles correctly and the string ls_b is set to the uppercase letter O:
string ls_b = "~h4F"
See Also
Special ASCII characters in the section called “Special ASCII characters” in PowerScript Reference.
Message text
Invalid ~ decimal character sequence in string.
Explanation
These statements generate C0066. Decimals must contain three digits in the range 000 to 255:
string ls_a = "~266" // generates C0066 string ls_b = "~3" // generates C0066
This statement compiles correctly and the string ls_b is set to the uppercase letter B:
string ls_b = "~066"
See Also
Special ASCII characters in the section called “Special ASCII characters” in PowerScript Reference.
Message text
Illegal to use array as for loop counter variable.
Explanation
This sample generates C0067:
int li_a int li_arr[2] int li_brr[2,2] for li_arr=li_arr[1] to li_brr[2,2] // generates C0067 beep(1) next for li_brr=li_a to li_brr[2,2] // generates C0067 beep(1) next
Message text
Illegal use of array in expression.
Explanation
The following samples generate C0068:
// Example 1 int li_arr[2] li_arr+=1 // generates C0068 int li_b[2]={1,2} li_b=1+{1} // generates C0068
// Example 2 int li_arr[2] int li_a li_a = li_arr.abc // generates C0068
// Example 3 int li_arr[2], li_int char lc_arr[2] string ls_str if li_int > 5 then ... elseif lc_arr < "ab" then //char arr<literal string (ok) ... elseif ls_str >= lc_arr then //string >= char arr (ok) ... elseif li_arr <= "ab" then //int arr <= literal string // generates C0068 ... elseif "ab" <= li_arr then //literal string <= int arr // generates C0068 ... end if
// Example 4 int li_arr[2] boolean lb_a if li_arr and lb_a then // generates C0068 and C0003 ... end if
// Example 5 int li_arr[2] int li_a boolean lb_a lb_a = not li_arr[] // generates C0068 li_a = -li_arr // generates C0068
// Example 6 int li_arr[2] int li_a li_a = 5 * li_arr // generates C0068
// Example 7 int li_arr[2] char lc_arr[2] int li_a string ls_a char lc_a ls_a = lc_arr + ls_a // char array + string (ok) ls_a = lc_arr + lc_a // char array + char (ok) ls_a = ls_a + lc_arr // string + char array(ok) ls_a = lc_a + lc_arr // char + char array (ok) ls_a = lc_arr + lc_arr // char array + char array (ok) // The following statements generate C0068 li_a = li_arr + li_arr // int array + int array (error) li_a = li_arr + 5 // int array + int (error) li_a = 5 + li_arr // int + int array (error)
// Example 8 int li_arr[2] char lc_arr[2] string ls_str if li_arr[1] = 5 then elseif lc_arr = "ab" then //char arr=literal string (ok) elseif ls_str = lc_arr then //string = char arr (ok) elseif li_arr = "ab" then //int arr = literal string // generates C0068 and C0011 elseif "ab" = li_arr then //literal string = int arr // generates C0068 and C0011 end if
Message text
Subscripted expression not an array.
Explanation
This sample generates C0069:
int li_arr[10] int li_1a,li_1b int li_1arr[2] for li_1b=li_1a[1] to li_1a[2] // generates C0069 for // li_la[1] and li_la[2] ... next int li_2arr[3]={1,2,3} int li_2b constant int li_2c=1 int li_2d=li_2arr[li_2b]*li_2b[li_2arr[li_2c]] // generates C0069 li_1a = li_arr[3] //ok
Message text
Mixing array and non-array in assignment statement.
Explanation
With the following variables declared as instance variables:
int ii_arr[2] int ii_b
this script in a function generates C0070:
int li_arr[4] = {0, 1, 2, 3} // ok int li_a = {0, 1, 2, 3} // generates C0070 this.ii_arr = {1,2} // ok this.ii_b = {1,2} // generates C0070 int li_brr[3] li_brr = {4,5,6} // ok int li_bli_b = {4,5,6} // generates C0070
Message text
Decimal precision value out of range: number.
Explanation
This statement generates C0072: Decimal precision value out of range: 39:
decimal {39} ld_a = 3.14159265 // generates C0072
This statement compiles successfully:
decimal {28} ld_a = 3.14159265
Message text
{"number"} meaningless with type type.
Explanation
This statement generates C0073: {3} meaningless with type string:
constant string {3} ls_str="aaa" // generates C0073
This statement generates C0073: {1} meaningless with type integer:
int {1} li_a[3]={1} // generates C0073
These statements compile successfully:
constant string ls_str="aaa" int li_a[3]={1} decimal {28} ld_a = 3.14159265
Message text
Illegal array declaration.
Explanation
For fixed-size arrays, you can use TO to specify a range of element numbers (instead of a dimension size) for one or more of the dimensions. The syntax is:
[ lowerbound1 TO upperbound1 {, lowerbound2 TO upperbound2}...]
The upperboundn value must be greater than the lowerboundn value. These statements generate C0074, because the upper bound is greater than the lower bound:
int li_array1[10 to 5] // generates C0074 int li_array2[1 to 9,3 to 1] // generates C0074
This statement compiles successfully:
int li_array3[1 to 9,3 to 6]
Message text
Integer constant out of range, max = 18446744073709551615.
Explanation
The maximum range for a longlong variable, which is the longest integer type supported in PowerScript, is from -9223372036854775808 to 9223372036854775807. These statements all generate C0077, because they all exceed the maximum value of 18446744073709551615 (9223372036854775808 + 9223372036854775807):
constant longlong lll_a = 18446744073709551616 longlong lll_b = 18446744073709551616/2 constant long ll_a = 18446744073709551616 int li_a = 18446744073709551616
These statements compile successfully, but you should be aware that you should not exceed the limits for each type specified in the documentation, because your code will fail at runtime:
constant longlong lll_a = 18446744073709551615 longlong lll_b = 18446744073709551615/2 constant long ll_a = 18446744073709551615 int li_a = 18446744073709551615
These statements compile successfully and the values specified are valid at runtime:
constant longlong lll_a = 9223372036854775807 longlong lll_b = 9223372036854775807/2 constant long ll_a = 2147483647 int li_a = 32767
Message text
Invalid time constant.
Explanation
Two of the following statements generate C0078 because they exceed the maximum range for the time datatype of 00:00:00 to 23:59:59:999999:
constant time lt_a=25:05:08 // generates C0078 constant time lt_b=23:59:59 // ok constant time lt_c=23:59:59.999999 // ok constant time lt_d=23:59:59.1000000 // generates C0078
Message text
Invalid date constant.
Explanation
Two of the following statements generate C0079. The ranges for each part of the date datatype are 1000 to 3000 for the year, 01 to 12 for the number of the month, and 01 to 31 for the day. In the first statement, both the month and day are out of range. In the third statement, there was no February 29 in the year 1900, but there was one in 2004, so the second statement compiles successfully:
constant date ld_a=1234-34-34 // generates C0079 constant date ld_b=2004-02-29 // ok constant date ld_c=1900-02-29 // generates C0079
Message text
Duplicate variable: variable.
Explanation
Declaring a variable with the same name twice in the same script generates C0081: Duplicate variable: li_a:
int li_a ... int li_a[4]// generates C0081
Message text
Reference argument must be a non-constant and non-readonly variable reference.
Explanation
If two functions are defined on a custom class user object, and function f1 takes one integer argument by reference, the following script in function f2 generates C0082:
f1(6) // generates C0082
Message text
Illegal for loop step value.
Explanation
The increment values in the STEP clauses in some of the following FOR loops generate C0083. Any increment value that evaluates to 0 generates the error. For example, for integer variables, 0.1 is rounded down to 0 and generates the error, while 2.3 is rounded down to 2.
For an integer, -1E-1 evaluates to 0 and the error is generated, but for decimal and real values, it evaluates to a small negative number and the error is not generated. However, the FOR loop will not be entered at runtime if the ending value of the variable is greater than the starting value.
int li_a long ll_a longlong lll_a dec ld_a real lr_a // Integer variables for li_a=1 to 5 step 0 // generates C0083 ... next for ll_a=1 to 5 step 0.1 // generates C0083 ... next for lll_a=1 to 5 step 2.3 // ok ... next for li_a=1 to 5 step -1E-1 // generates C0083 ... next // Decimal variables for ld_a=1 to 5 step 0.1 // ok ... next for ld_a=1 to 5 step -1E-1 // ok ... next for ld_a=1 to 5 step 0.0 // generates C0083 ... next // Real variables for lr_a=1 to 5 step 0.1 // ok ... next for lr_a=1 to 5 step -1E-1 // ok ... next for lr_a=1 to 5 step 0E1 // generates C0083 ... next
Message text
Bad number of arguments for function: function.
Explanation
If two functions are defined on a custom class user object and function f1 takes one integer argument by value, the following script in function f2 generates C0084:
int a, b f1(a, b) // generates C0084
Message text
Duplicate instance variable name: variable.
Explanation
Declaring an instance variable with the same name twice for the same object generates C0086: Duplicate instance variable name: li_a:
int li_a ... int li_a[4]// generates C0086
Message text
Incompatible types in array list expression: type1, type2.
Explanation
The first statement in this example generates C0090: Incompatible types in array list expression: long, string. The second statement generates C0090: Incompatible types in array list expression: real, boolean:
int li_arr[2]={1,'a'} // generates C0090 long ll_arr[4] = {1, 2.3, 4E3, true} // generates C0090
Message text
Returned expression cannot be an array.
Explanation
The return statement in this example generates C0091:
int li_arr[2]={1,2} return li_arr // generates C0091
Message text
Return expression in subroutine.
Explanation
The return statement in this function that was defined as returning no value generates C0092:
return 10 // generates C0092
Message text
Incompatible type type returned for function.
Explanation
The return statement in this function that was defined as returning no value generates C0093 and C0094:
string a return a // generates C0093 and C0094
Message text
Routine must return a value.
Explanation
Omitting the return statement in a function that was defined as returning a value generates C0094.
Message text
Referencing number dimensional array with number subscripts.
Explanation
The FOR statement in this function generates C0096: Referencing 3 dimensional array with 2 subscripts:
int li_num,li_arr[2,2,1]={1,2,3,4} for li_num=li_arr[1,1] to 5 // generates C0096 ... next
Message text
Fixed length binary arrays not supported; using unbounded.
Explanation
The second statement in this example generates C0099. The third statement defined an unbounded array of blobs:
blob {5} lb_a blob {5} lb_arr[] // generates C0099 blob lb_arr2[]
Message text
Initialization of binary variables not supported.
Explanation
Attempting to initialize a blob generates C0100:
blob lb_a=1 // generates C0100
Message text
Dynamic SQL command variable must be a string.
Explanation
You can use only string variables in dynamic SQL commands. The following sample generates C0102:
int li_a prepare sqlsa from :li_a; // generates C0102 execute immediate :li_a; // generates C0102
This sample compiles without error:
string ls_a prepare sqlsa from :ls_a; // ok execute immediate :ls_a; // ok
See Also
Using dynamic SQL in the section called “Using dynamic SQL” in PowerScript Reference.
Message text
Dynamic SQL command must reference DynamicStagingArea object.
Explanation
PowerBuilder has four dynamic SQL formats. You must reference a DynamicStagingArea object in some dynamic SQL commands. For more information, see the section called “SQL Statements” in PowerScript Reference for more information.
The last five statements in this example generate C0103 because they reference a DynamicDescriptionArea object (sqlda) or other variables instead of a DynamicStagingArea object (sqlsa):
string str int num long l int numarr[] throwable t prepare sqlsa from :str; describe sqlsa into sqlda; execute sqlsa using :num; declare my_cursor dynamic cursor for sqlsa; declare my_proc dynamic procedure for sqlsa; // The following statements generate C0103 prepare num from :str; describe numarr into sqlda; execute sqlda using :num; declare my_cursor1 dynamic cursor for t; declare my_proc1 dynamic procedure for l;
See Also
Using dynamic SQL in the section called “Using dynamic SQL” in PowerScript Reference.
Message text
Open/execute command with parameters must reference dynamic cursor/procedure.
Explanation
PowerBuilder has four dynamic SQL formats. If you use an OPEN or EXECUTE statement that has parameters, you must reference a dynamic cursor or procedure. For more information, see the section called “SQL Statements” in PowerScript Reference for more information.
Two statements in this example generate C0104 because they reference a cursor or procedure that was not declared using the DYNAMIC keyword:
int li_a declare curs cursor for select emp_id from employee; declare dyncurs dynamic cursor for sqlsa; declare proc procedure for webchanged; declare dynproc dynamic procedure for sqlsa; open dynamic curs using :li_a; // generates C0104 execute dynamic proc using :li_a; // generates C0104 open dynamic dyncurs using :li_a; // ok execute dynamic dynproc using :li_a;// ok
See Also
Using dynamic SQL in the section called “Using dynamic SQL” in PowerScript Reference.
Message text
Dynamic SQL command must reference DynamicDescriptionArea object.
Explanation
PowerBuilder has four dynamic SQL formats. You must reference a DynamicDescriptionArea object in some dynamic SQL commands. For more information, see the section called “SQL Statements” in PowerScript Reference for more information.
The last three statements in this example generate C0105 because they reference a DynamicStagingArea object (sqlsa) or other variables instead of a DynamicDescriptionArea object (sqlda):
int num int numarr[] throwable t declare proc procedure for webchanged; declare dynproc dynamic procedure for sqlsa; declare dyncursor dynamic cursor for sqlsa; fetch proc using descriptor sqlda; execute dynamic dynproc using descriptor sqlda; open dynamic dyncursor using descriptor sqlda; declare proc1 procedure for webchanged; declare dynproc1 dynamic procedure for sqlsa; declare dyncursor1 dynamic cursor for sqlsa; // The following statements generate C0105 fetch proc using descriptor num; execute dynamic dynproc using descriptor numarr; open dynamic dyncursor using descriptor t;
See Also
Using dynamic SQL in the section called “Using dynamic SQL” in PowerScript Reference.
Message text
'Super' keyword can be used only within an inherited type.
See Also
Using dynamic SQL in the section called “Using dynamic SQL” in PowerScript Reference.
Message text
Open/execute command with descriptor must reference dynamic cursor/procedure.
Explanation
PowerBuilder has four dynamic SQL formats. If you use an OPEN or EXECUTE statement with a descriptor, you must reference a dynamic cursor or procedure.
Two statements in this example generate C0107 because they reference a cursor or procedure that was not declared using the DYNAMIC keyword:
int li_a declare curs cursor for select emp_id from employee; declare dyncurs DYNAMIC cursor for sqlsa; declare proc procedure for webchanged; declare dynproc DYNAMIC procedure for sqlsa; // The following statements generate C0107 open dynamic curs using descriptor sqlda; execute dynamic proc using descriptor sqlda; // The following statements compile without error open dynamic dyncurs using descriptor sqlda; execute dynamic dynproc using descriptor sqlda;
See Also
FOR...NEXT in the section called “FOR...NEXT” in PowerScript Reference.
Message text
Private or protected function cannot be accessed: function.
Explanation
You cannot access a private or protected function in another object. In this example, of_add is a protected function in n_math that is being called from another object:
integer li_result li_result = n_math.of_add(10, 20) // generates C0109
See Also
Message text
Mixing signed and unsigned values in for statement
Explanation
Two statements in this example generate C0110 because they mix int and uint values in the FOR statement:
int li_a, li_b, li_c uint lu_a, lu_b, lu_c for li_a = li_b to li_c // both int values ... next for lu_a = lu_b to lu_c // both uint values ... next for li_a = li_b to lu_c // generates C0110 ... next for lu_a = li_b to lu_c // generates C0110 ... next
Message text
Incompatible types in array assignment: type1, type2.
Explanation
This example generates C0112 because it mixes int and char values in the array assignment:
int li_arr[2] = {'a','b'} char lc_arr[2] = {3, 0.2} int arr[] arr = {'a', 'b', 'c'}
See Also
Assignment statement in the section called “Assignment” in PowerScript Reference.
Message text
Illegal datatype for increment statement: type.
Explanation
The datatype of the variable used with the increment assignment shortcut must be a datatype that can be incremented, such as a numeric or Any datatype. Other datatypes, such as Char or String, generate C0117, as shown in this example:
int li_a any la_a char lc_a li_a++ // ok la_a++ // ok lc_a++ // generates C0117
See Also
Assignment statement in the section called “Assignment” in PowerScript Reference.
Message text
Illegal datatype for decrement statement: type.
Explanation
The datatype of the variable used with the decrement assignment shortcut must be a datatype that can be decremented, such as a numeric or Any datatype. Other datatypes, such as Char or String, generate C0118, as shown in this example:
int li_a any la_a char lc_a li_a -- // ok la_a -- // ok lc_a -- // generates C0118
See Also
Assignment statement in the section called “Assignment” in PowerScript Reference.
Message text
Function argument differs from ancestor only by pass by reference or value for function function.
Message text
Illegal expression on left side of assignment.
Explanation
The expression on the left side of an assignment must be the name of a variable or object property to which you want to assign a value. For example, the classname function returns the class of an object. You cannot assign a value to it:
powerobject po po = create powerobject po.classname() = "newname" // generates C0124 // these statements assign the string // powerobject to ls_classname string ls_classname ls_classname = po.classname()
See Also
Assignment statement in the section called “Assignment” in PowerScript Reference.
Message text
Only one variable allowed in INTO clause of SelectBlob command.
Explanation
The INTO clause in a SELECTBLOB statement can contain only one variable:
blob lb_a, lb_b selectblob catalog_picture into :lb_a from product; selectblob catalog_picture into :lb_a, :lb_b // generates C0128 from product;
See Also
SELECTBLOB statement in the section called “SELECTBLOB” in PowerScript Reference.
Message text
Indicator variables not supported in SelectBlob command.
Explanation
A special type of integer variable called an indicator variable is used in SELECT, FETCH, UPDATE, UPDATE WHERE CURRENT, and INSERT commands to identify null values and in SELECT and FETCH commands to identify truncated output strings. The use of indicator variables in SELCTBLOB statements is restricted.
See Also
SELECTBLOB statement in the section called “SELECTBLOB” in PowerScript Reference.
Message text
Duplicate keyword keyword used in a method call.
Explanation
You cannot use the same keyword more than once when calling a function or event. This example repeats the use of the DYNAMIC keyword:
dynamic f2() dynamic dynamic f2() // generates C0131 dynamic post dynamic f2() // generates C0131
See Also
Syntax for calling PowerBuilder functions and events in the section called “Syntax for calling PowerBuilder functions and events” in PowerScript Reference.
Message text
The DYNAMIC keyword can be specified only once per method call.
Explanation
You cannot use the DYNAMIC keyword more than once when calling a function or event. In this example, a nonvisualobject mynvo has a simple function, returnself, that takes a nonvisual object as an argument and returns the nonvisualobject. The following example shows a second function that calls the returnself function iteratively, effectively repeating the use of the DYNAMIC keyword:
mynvo a,b,c,d returnself(a).dynamic returnself(returnself(b).dynamic returnself(c)).returnself(d) // ok returnself(a).returnself(dynamic returnself(b).dynamic returnself(c)).returnself(d) // generates C0132 returnself(a).dynamic returnself(returnself(b).returnself(c)).dynamic returnself(d) // generates C0132
See Also
Using cascaded calling and return values in the section called “Using cascaded calling and return values” in PowerScript Reference.
Message text
The POST keyword can be applied only to the last method in a sequence of calls.
Explanation
In a sequence of calls, you can apply the POST keyword only to the last method in the sequence because POST makes the return value unavailable to the caller. Calls before the last call must return a valid object that can be used by the following call. In this example, a nonvisualobject mynvo has several simple functions, return1, return2, and so on, each of which takes a nonvisual object as an argument and returns the nonvisualobject. The following code shows another function that uses the POST keyword incorrectly:
mynvo a,b,c,d return0(a).post return1(d) // ok return0(a).post return1(d).post // generates C0133 return2(a).post return3(return4(b).return5(c)).post return6(d) // generates C0133
See Also
Using cascaded calling and return values in the section called “Using cascaded calling and return values” in PowerScript Reference.
Message text
The STATIC keyword cannot override the DYNAMIC keyword.
Explanation
If you use the DYNAMIC keyword in a chain of cascaded calls, it carries over to all function calls that follow. You cannot apply the STATIC keyword to calls that follow the DYNAMIC keyword. In this example, a nonvisualobject mynvo has a simple function, returnself, that takes a nonvisual object as an argument and returns the nonvisualobject. The following code shows two statements that generate C0134 because the STATIC keyword follows the DYNAMIC keyword:
mynvo a,b,c,d returnself(a).static returnself(b).dynamic returnself(c) // ok returnself(a).dynamic returnself(b).static returnself(c) // generates C0134 d = dynamic returnself(a).returnself(b).static returnself(c) // generates C0134
See Also
Static versus dynamic calls in the section called “Static versus dynamic calls” in PowerScript Reference.
Message text
The keywords keyword1 and keyword2 cannot be applied to the same method.
Explanation
When you call a function or event, you can only use one of the following pairs of keyword: FUNCTION and EVENT, STATIC and DYNAMIC, and TRIGGER and POST.
// generates C0135: The keywords function and event // cannot be applied to the same method function event f1() // generates C0135: The keywords static and dynamic // cannot be applied to the same method static dynamic f1() // generates C0135: The keywords trigger and post // cannot be applied to the same method trigger post f1()
See Also
Syntax for calling PowerBuilder functions and events in the section called “Syntax for calling PowerBuilder functions and events” in PowerScript Reference.
Message text
It is illegal to POST a method whose result is needed as an argument value, or for a subsequent expression.
Explanation
In this example, a nonvisualobject has a simple function, f2, that takes an integer argument and returns 1. The following code shows another function that uses the POST keyword incorrectly:
int li_a = post f2(1) // generates C0136 int li_b li_b = 5 + post f2(2) // generates C0136 li_b = f2(post f2(3)) // generates C0136 post f2(4) // ok
See Also
Triggering versus posting functions and events in the section called “Triggering versus posting functions and events” in PowerScript Reference.
Message text
It is illegal to POST an INTRINSIC method.
Explanation
Some built-in PowerScript functions, including Int, Abs, Blob, Ceiling, Exp, Len, Max, Min, IsValid, Trim, and Upper, cannot be posted because of the way they are handled internally. For example:
post MessageBox("", "") //ok post blob("") // generates C0138
See Also
Triggering versus posting functions and events in the section called “Triggering versus posting functions and events” in PowerScript Reference.
Message text
Illegal datatype for CREATEUSING statement: type. Must be a non-array variable or expression resulting in a STRING or an ANY.
Explanation
You cannot use an array or any expression that does not result in an Any or String datatype in a CREATE USING statement:
string ls_arr[3] int li_a any la_a, la_a2 la_a2 = create using la_a // ok - any la_a2 = create using ls_arr[1] // ok - results in string la_a2 = create using ls_arr // array -generates C0139 la_a2 = create using li_a // int - generates C0139
See Also
CREATE in the section called “CREATE” in PowerScript Reference.
Message text
The datatype for a CONSTANT property or variable must be either a simple non-object type or an enumerated type.
Explanation
You cannot use the CONSTANT keyword when you declare an object of system object type:
constant commandbutton cb_1 // generates C0140 constant transaction mytrans // generates C0140 constant border mybordertype = raised!// ok commandbutton cb_2 // ok transaction mytrans2 // ok
See Also
Declaring constants in the section called “Declaring constants” in PowerScript Reference.
Message text
A property or variable marked as CONSTANT must have an initializing value or expression.
Explanation
You must supply an initial value when you declare a constant:
constant int li_a // generates C0141 constant date ld_a // generates C0141 constant int li_b = 100 // ok constant date ld_b = today() // ok
See Also
Declaring constants in the section called “Declaring constants” in PowerScript Reference.
Message text
A property or variable marked as CONSTANT cannot be an array.
Explanation
You cannot use the CONSTANT keyword when you declare an array:
constant int li_arr[3] // generates C0142 constant date ld_arr[2] // generates C0142
See Also
Declaring constants in the section called “Declaring constants” in PowerScript Reference.
Message text
A readonly property can be modified only in an event or function in its parent class.
Message text
Multiple routines named routine were found that match this set of arguments, causing an ambiguous match.
Message text
A READONLY argument cannot be assigned into or passed to a function or event as a reference argument.
Explanation
The function f2 takes an integer argument by reference. The following function, f1, takes a readonly integer argument:
f2(ai_readonly) // generates C0145 ai_readonly = 1 // generates C0145 return 1
See Also
Passing arguments to functions and events in the section called “Passing arguments to functions and events” in PowerScript Reference.
Message text
The identifier identifier conflicts with an existing global variable with this name. The new definition of identifier will take precedence and the prior value will be ignored until this version of identifier goes out of scope.
Message text
The identifier identifier conflicts with an existing shared variable with this name. The new definition of identifier will take precedence and the prior value will be ignored until this version of identifier goes out of scope.
Message text
The identifier identifier conflicts with an existing property with this name. The new definition of identifier will take precedence and the prior value will be ignored until this version of identifier goes out of scope.
Message text
The identifier identifier conflicts with an existing property with this name in the parent class. The new definition of identifier will take precedence and the prior value will be ignored until this version of identifier goes out of scope.
Message text
Function function has been renamed to newfunction (no prefix); switch to the new name.
Message text
string can be specified only on PUBLIC or PROTECTED property definitions.
Message text
The access modifier access modifier can be specified only once per property declaration.
Message text
The property property was found, but insufficient rights are available to access it.
Message text
The property property was found, but insufficient rights are available to access it.
Message text
A call to a nonexistent ancestor event was detected and will be ignored. This message is triggered by removing an event definition from an ancestor object while the event still has script in a descendant object.
See Also
Calling functions and events in an object's ancestor in the section called “Calling functions and events in an object's ancestor” in PowerScript Reference.
Message text
The property property was found in class class, but insufficient rights are available to access it.
Explanation
You can access private or protected variables in an object only from the object itself. In this example, Employee is a custom class user object with a private or protected variable of type double named salary. Attempting to access the variable generates C0158:
double salary Employee e e = create Employee salary = e.salary // generates C0158
See Also
Access for instance variables in the section called “Access for instance variables” in PowerScript Reference.
Message text
Conversion of string1(string2) failed.
Probable library file I/O error.
Message text
Regenerate of string1(string2) failed.
Probable library file I/O error.
Message text
Regenerate of string1(string2) failed.
Destination library is not in the current library list.
Message text
Cannot regenerate string1(string2) while it is open in another painter.
Message text
The definition of referenced global variable variable was improperly compiled in object object.
Message text
The type type of referenced global variable variable is an unresolved external.
Message text
The identifier identifier conflicts with a variable variable of the same name. It can be accessed using only an explicit 'this.'
Message text
FOR statement end value out of range for iterator variable. Use type for the type of the iterator variable.
Explanation
The end value for the iterator in a FOR loop must be within the range defined for the datatype:
int li_a, li_b for li_a = li_b to 2147483648 // generates C0171 next for li_a = li_b to 2147483647 // ok next
See Also
Standard datatypes in the section called “Standard datatypes” in PowerScript Reference.
Message text
Type of actual parameter cannot be ancestor of formal reference parameter type.
Message text
Strings cannot be implicitly converted into multi-dimensional static character arrays. Only one-dimensional or dynamic arrays are supported.
Explanation
Attempting to assign a string to a multidimensional static character array. A string can be assigned to a one-dimensional array:
string ls_str ls_str="abcdef" char lc_str[2,3] char lc_str2[2] lc_str=ls_str // generates C0175 lc_str2=ls_str // ok return 1
See Also
Values for array elements in the section called “Values for array elements” in PowerScript Reference.
Message text
Badly ordered TYPE and VARIABLE declarations. Is this modified exported source?
Message text
Different DESCRIPTOR values on prototype:
"value1"
and routine declaration:
"value2"
Message text
Different REF TO values on prototype:
"value1"
and routine declaration:
"value2"
Message text
Function function is now obsolete and will be removed in a future release.
Message text
The identifier identifier conflicts with an existing constant constant with this name.
Message text
Illegal use of an Arraylist. An Arraylist can be used only to initialize an array.
Message text
Argument value not available at compile time. Use a separate assignment statement for initialization.
Message text
SQL host variable or SQL name cannot be a constant or read-only variable.
Explanation
The INTO clause in the following function, which takes a readonly argument (ai_readonly) attempts to use the readonly variable as well as two constant variables:
constant int outvar_const = 1 int outvar = 1 constant int invar = 1 constant int indicator = 1 select employee.emp_id // generates C0189 into :outvar:indicator, :ai_readonly, :outvar_const from employee where employee.emp_id = :invar using sqlca; return 1
See Also
SELECT in the section called “SELECT” in PowerScript Reference.
Message text
Instance variables of local structure type structure will be implicitly private in the next release.
Message text
Instance variable name conflicts with an inherited private instance variable: variable.
Message text
Declaration using descendant's nested type type2 not supported. type1 is an ancestor of type2.
Message text
One or more of the files in your library list could not be opened for write.
Message text
Missing pcode block for indirect function.
Possible cause: library missing from library list.
Message text
EAServer/Application Server component deployment error: error string.
Message text
Illegal datatype type used in statement statement. Must be a variable that derives from the system type THROWABLE.
Message text
Try statement must contain at least one catch block or a finally block.
Message text
Exception type exception must either be caught in this method or declared in the throws clause of this method prototype.
Message text
Catch statement unreachable. Ancestor (or same type) is caught in previous statement.
Message text
Append extra argument argument to function function for backward compatibility.
Message text
Append ALIAS FOR clause to external function function for backward compatibility.
Message text
An application object cannot be added to a namespace. The defined namespace namespace will be ignored.
Message text
Function or event method must be declared before it can be compiled.
Message text
Please note that the user-defined event event can now be implemented using the equivalent system event event.
Message text
Migration: Invalid multibyte character(s) in source string1(string2) have been replaced with the character '?'.
Message text
The statement is not complete.
Explanation
Error C0300 is generated when you deploy a .NET target that contains an incomplete statement inside a conditional compilation clause:
int i #if defined PBWEBFORM the i = // generates C0300 #end if
Message text
; expected.
Explanation
Error C0301 is generated when you deploy a .NET target that has a statement with a missing semicolon inside a conditional compilation clause:
int EmpNbr string EmpName #if defined PBWEBFORM then INSERT INTO Employee (employee.Emp_nbr, employee.Emp_name) VALUES (:EmpNbr, :EmpName) USING sqlca // generates C0301 #end if
Message text
) expected.
Explanation
Error C0302 is generated when you deploy a .NET target that has a statement with a missing closing parenthesis inside a conditional compilation clause:
#if defined PBWEBFORM then System.Net.Mail.Attachment att // the following staement generates C0302 att = create System.Net.Mail.Attachment("c:\temp\emp_data.pdf" #end if
Message text
{ expected.
Explanation
This is an internal error that may be generated in the context of other errors.
Message text
Syntax Error, string expected.
Explanation
Error C0304 is generated when you deploy a .NET target that has a statement with a missing component inside a conditional compilation clause:
#if defined PBWEBFORM then // the following statement generates C0304: // Syntax Error 'RCURLY' expected. string ls_city[ ] = { "aaaa", "bbbb", "cccc" // the following statement generates C0304: // Syntax Error 'IDENTIFIER' expected. string ls_city[ ] = "aaaa", "bbbb", "cccc" } #end if
Message text
; or newline expected.
Explanation
This is an internal error that may be generated in the context of other errors.
Message text
Syntax error: string.
Explanation
Error C0306 is generated when you deploy a .NET target that has a statement with incomplete or incorrect syntax like the following inside a conditional compilation clause:
#if defined PBWEBFORM then integer i = // generates C0306 #end if
The following code also generates error C0306:
#if defined PBDOTNET then // generates C0306: Syntax error: 'create' System.Text.ASCIIEncoding enc = create & System.Text.ASCIIEncoding #end if
To avoid the error, declare an instance of the object and issue the CREATE statement on separate lines:
#if defined PBDOTNET then // compiles successfully System.Text.ASCIIEncoding enc enc = create System.Text.ASCIIEncoding #end if
Message text
Syntax error: unexpected string.
Explanation
Error C0307 is generated when you deploy a .NET target that has a statement like the following inside a conditional compilation clause:
#if defined PBWEBFORM then halt clos // generates C0307: // Syntax error: unexpected "clos" #end if
Message text
'end if' expected.
Explanation
Error C0308 is generated when you deploy a .NET target that has an IF statement with no closing END IF inside a conditional compilation clause:
#if defined PBWEBFORM then if a then // generates C0308 #end if
Message text
'end try' expected.
Explanation
Error C0309 is generated when you deploy a .NET target that has a TRY statement with no closing END TRY inside a conditional compilation clause:
n_throwable1 thr1 n_throwable2 thr2 n_throwable3 thr3 n_throwable4 thr4 #if defined pbwebform then try try hasthrow1() throw thr3 throw thr4 catch (n_throwable4 exce4) end try catch (n_throwable3 exce3) // missing end try generates C0309 #end if
Message text
'end choose' expected.
Explanation
Error C0310 is generated when you deploy a .NET target that has a CHOOSE CASE statement with no closing END CHOOSE inside a conditional compilation clause:
decimal weight decimal postage #if defined pbwebform then choose case weight case is<10 postage=weight*0.30 case 10 postage=4.50 case 11 to 20 postage=6.0 case is>21, is<=40, 44 postage=10.0 case else postage=25.00 // missing end choose generates C0310 #end if
Message text
'end for' expected.
Explanation
Error C0311 is generated when you deploy a .NET target that has a FOR statement with no closing END FOR inside a conditional compilation clause:
int i #if defined PBWEBFORM then for i = 1 to 100 // missing end for generates C0311 #end if
Message text
An object reference is required for a nonstatic field, method, or property.
Explanation
To access a nonstatic variable in a .NET class in a conditional compilation clause, an instance of the class must be created. This example uses a simple public class Department that is in the .NET assembly PBInterop.dll. Department has two member variables: public string Name and public static int ID. In the following example, the attempt to access the nonstatic variable Name without creating and using an instance of the Department class generates C0312:
String dept_name #if defined pbwebform then PBInterOp.Department dept dept_name = PBInterOp.Department.Name // C0312 #end if
This example deploys without error because an instance of the Department class is created and used to access the nonstatic variable:
String dept_name dept = create PBInterOp.Department dept_name = dept.Name #end if
See Also
Message text
Static member name cannot be accessed with an instance reference. Qualify the static member with a type name.
Explanation
To access a static variable in a .NET class in a conditional compilation clause, you must use a type name, not a reference to an instance of the class. This example uses a simple public class Department that is in the .NET assembly PBInterop.dll. Department has two member variables: public string Name and public static int ID. In the following example, the attempt to access the static variable ID using an instance of the Department class generates C0313:
long dept_id #if defined pbwebform then PBInterOp.Department dept dept = create PBInterOp.Department dept_id = dept.ID // generates C0313 #end if
This example deploys without error because the type name of the class is used to access the static variable:
long dept_id #if defined pbwebform then dept_id = PBInterOp.Department.ID #end if
See Also
Message text
Value of maths literal above maximum allowed for datatype type.
Explanation
Warning C0314 is generated when you deploy a .NET target that sets the value of a numeric variable to a value greater than its range, for example:
int i = 4449999998999 // generates C0314
Message text
Value of maths literal below minimum allowed for datatype type.
Explanation
Warning C0315 is generated when you deploy a .NET target that sets the value of a numeric variable to a value that is less than its minimum value, for example:
int i = -4449999998999 // generates C0315 byte b = -1 // generates C0315
Message text
Function scope cannot be of type type.
Explanation
Error C0316 is generated when you deploy a .NET target that contains a statement like the following in the body of a function, where f1 is a function that does not return a value:
f1().f2() // generates C0316: Function scope // cannot be of type "void"
Message text
'this' cannot be used in a global function.
Explanation
Warning C0318 is generated when you deploy a .NET target that contains a global function that uses the this keyword:
PowerObject po po = this // generates C0318
Message text
No suitable constructor for statement statement: name.
Explanation
Error C0319 is generated when you deploy a .NET target (Discontinued) that uses incorrect syntax in a statement that requires a constructor. This example uses a simple public class Class1 that is in the .NET assembly Interop.dll. Attempting to create an instance of Class1generates C0319, because the constructor for Class1 does not take a System.Nullable argument:
#if defined PBDOTNET then Interop.Class1 obj System.Nullable p p = create System.Nullable obj = create Interop.Class1(p) //generates C0319: // No suitable constructor for create statement: class1 #end if
Message text
Event (event) cannot be overloaded: event.
Explanation
Error C0320 is generated when you deploy a .NET target that contains an inherited event that is overloaded. This can occur if the datatype of an inherited event's argument is changed in the Source editor. Suppose a window w_1 has an event e that takes an integer argument. If w_2 is inherited from w_1, but the inherited event's argument is changed from integer to long, C320 is generated. This is the incorrect code in the Source editor:
global type w_2 from w_1 event e ( long i ) // generates C320 end type global w_2 w_2
Message text
Event (event) is different from its prototype: event.
Explanation
Error C0321 is generated when you deploy a .NET target that contains an inherited event that has a different argument from its prototype. This can occur if the datatype of an inherited event's argument is changed in the Source editor. Suppose a window w_1 has an event e that takes an integer argument. If w_2 is inherited from w_1, the inherited event also takes an integer argument. If the event is redefined to take a long argument in the Source editor, C321 is generated. This is the incorrect code in the Source editor:
global type w_2 from w_1 event e ( integer i ) end type global w_2 w_2 event e ( long i ) // generates C321 end type
Message text
No label label within the scope of the GoTo statement.
Explanation
Error C0322 is generated when you deploy a .NET target that contains a GoTo statement that jumps into a branch of a compound statement. This is legal in PowerScript because the concept of scope inside a function does not exist. In C#, the IF and ELSE clauses are in different scopes.
int li_num=123 boolean b=true if b then start: li_num++ else goto start // generates C0322 end if
Message text
Downcast warning: assign/pass type type1 to type type2 might cause runtime errors.
Message text
Calling an indirect ancestor event (event) is not supported in .NET.
Explanation
Suppose that there are three windows, w_1, w_2, and w_3. w_1 inherits from Window, w_2 inherits from w_1, and w_3 inherits from w_2. Each of these classes handles the Clicked event. In the Clicked event of w_3, it is legal to code the following in PowerScript:
call w_1::clicked
However, in C#, calling the base method of an indirect base class from an override method is not allowed. The previous statement translates into the following C# code, which might produce different behavior:
base.clicked();
In this example, a possible workaround is to move code from the Clicked event of the indirect ancestor window to a window function, and then call the function, rather than the original Clicked event, from the descendant window.
Message text
Function (function) has a different return type (type1) from its prototype's (type2).
Explanation
Error C0325 is generated when you deploy a .NET target that contains a function whose return type has been changed. This can occur if the return datatype is changed in the Source editor. This is the incorrect code in the Source editor:
forward prototypes public function integer f1 () end prototypes public function long f1 ();return 2 // generates C0325 end function
Message text
Return statement cannot be used in 'finally' clause.
Explanation
PowerScript allows you to code a Return statement in the Finally clause of a try–catch statement, but C# does not support Return statements in Finally clauses. If your code includes such statements, C0326 is generated when you deploy a .NET target:
integer ll_num=123 TRY ... CATCH (throwable exec1) ... FINALLY return ll_num // generates C0326 END TRY return ll_num
Message text
The best overloaded method match for method has some invalid arguments.
Explanation
If a custom class user object has two functions, f1 and f2, and f1 takes a long argument, code like the following in the body of f2 generates a "Bad argument list for function: f1" error when it is compiled. If the code is enclosed in a .NET conditional compilation block, the compile-time error is not generated and C0327 is generated when you deploy the .NET target:
string s='123' f1(s) // generates C0327
Message text
Private function cannot be inherited.
Explanation
If an object contains a private function, you cannot change the body of that function in an inherited object. Suppose a window w_1 has a private function f1 that takes an integer as an argument and returns an integer. If w_2 inherits from w_1, any code in the body of f1 in w_2 generates C0328 when you deploy the .NET target:
return 1 //generates C0328
Message text
Function function has no prototype.
Explanation
Error C0329 is generated when you deploy a .NET target that contains a function that has no prototype. This can occur if the function is added without a prototype in the Source editor. This incorrect code in the Source editor compiles but generates C0329 when the .NET target is deployed:
global type of_test from function_object end type forward prototypes global function integer of_test (integer arg1) end prototypes global function integer of_test (integer arg1);return 1 end function function integer of_test2 (integer arg2);return 2 // generates C0329 end function
Message text
Cannot create an instance of the abstract class or interface name.
Explanation
Error C0330 is generated if you try to create an instance of an abstract class or interface, as in the following code example:
System.Enum e e = create System.Enum
Message text
Static member name cannot be accessed with a function or property call.
Explanation
Error C0331 is generated if you call a static member in a function or property. For example, each of the following calls generates error C0331:
s = emp.GetAssest().StaGetName()
s = dept.EmpField.StaName;