Example 1 function TypeMismatch var BCBusComp var MyDateDate new Date BC MyDate

Example 1 function typemismatch var bcbuscomp var

This preview shows page 318 - 321 out of 334 pages.

Example 1 function TypeMismatch() { var BC:BusComp; var MyDate:Date = new Date(); BC =MyDate; // MyDate is not the same data type // as strongly typed variable BC } Example 1 function fn () { var a: String; a = new Date (); //Type mismatch: strongly typed //String is assigned a Date. } A value that belongs to one data type is assigned to a strongly typed variable of another data type. For more information, see “Using Strongly Typed and Typeless Variables” on page 45 . Return type is wrong. Defined return type is return_type . function fn (): Array { return new Date (); } fn (); The actual return type is different from the defined return type. The actual return type cannot be implicitly converted to the defined type. No such label label defined. switch( switch_variable ) { case value1 : statement_block break labl; // where labl is not a valid label . . . [default: statement_block; ] } The label referenced in a Break statement or a Goto statement is defined. You must make sure the label name is correct and that the label is defined in the code. In the example, if the Break statement is to resume at the labl location, then you must define the labl label. Table 209. Semantic Error Messages in Siebel eScript Message Examples Cause
Image of page 318
Compilation Error Messages Siebel eScript Language Reference Version 8.1, Rev. A 319 Continue out of loop. function ContinueOut() { var i =0 while (i<3) { i++; continue Mylabel; // Mylabel label is defined //outside of the while loop. } Mylabel: var a=1; } A continue command attempts to branch to a label that is not in a loop. Label redefined. function LabelError() { Outer: for (var i = 0; i < 5; i++) { var j = 0; Inner: while (j!=5) { j++; continue Inner; Inner: //Label Inner is //redefined. var b=1; } } } A label already exists that possesses the same name. function function_label is double defined. function fn () { TheApplication().RaiseErrorText ("fn"); } function fn () // second declaration of function // fn is not allowed { TheApplication().RaiseErrorText ("fn again"); } A function already exists that possesses the same name. In the example, you must define the function with a name other than the following name: fn Table 209. Semantic Error Messages in Siebel eScript Message Examples Cause
Image of page 319
Siebel eScript Language Reference Version 8.1, Rev. A Compilation Error Messages 320 Calling function function_label with insufficient number of arguments. function main () { fn (); // does not provide enough //parameters } function fn (arg1: chars, arg2: chars) { ... } You did not provide all of the arguments that the function requires. The number of arguments you include must equal the number specified in the function definition. In the example, the following function requires two character arguments: fn Cannot access property property_name on native type. function main () { var a:chars = "123"; a.m_prop = "123"; // chars is a primitive, so it // has no properties } main (); You cannot assign a property to a variable that is of a primitive data type, such as char, float, or bool.
Image of page 320
Image of page 321

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors