Error when defining a variable from a class

Hi,
I'm getting this error message when trying to define a
variable from a class:
'1086: Syntax error: expecting semicolon before left paren.'
I can't see where the error is.
The scripts Question.as and Codeframe.as is located int the
folder Mycomponents under the project.
Regards
/Acke
**** Main app *****
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
import myComponents.*;
var Question():myComponents.Question=new Question(); // !!
This line causes the error !!
other code goes here....
]]>
</mx:Script>
**** The class definition ******
package myComponents
//import other classes needed
import Mycomponents.Codeframe
public class Question {
// Define properties and methods.
// Define public vars.
public var Qtype:string;
public var Condition:string;
public var Qnumber:string;
public var Qheading:string;
public var Pretext:string;
public var Qtext:string;
public var Posttext:string;
public var Codeframe():string;
public var Reserved:string;
public var EditableFrom:string;
public var EditableTo:string;
public var Decimal:string;
public var SetQfactor:string;
public var Logic_if():string;
public var Logic_then():string;
// Public constructor.
//public function Question(){
// do stuff to set initial values for properties
public function Question(Type:string,
Condition:string,
Qnumber:string,
Qheading:string,
Pretext:string,
Qtext:string,
Posttext:string,
Codeframe():string,
Reserved:string,
EditableFrom:string,
EditableTo:string,
Decimal:string,
SetQfactor:string,
Logic_if():string,
Logic_then():string,
):Void
this.Type=Type;
this.Condition=Condition;
this.Qnumber=Qnumber;
this.Qheading=Qheading;
this.Pretext=Pretext;
this.Qtext=Qtext;
this.Posttext=Posttext;
this.Codeframe()=Codeframe();
this.Reserved=Reserved;
this.EditableFrom=EditableFrom;
this.EditableTo=EditableTo;
this.Decimal=Decimal;
this.SetQfactor=SetQfactor;
this.Logic_if()=Logic_if();
this.Logic_then()=Logic_then();
}

1.
It should be
var theQuestion:Question = new
Question(sType,sCondition:string,sQnumber,sQheading,sPretext,sQtext,sPosttext,
sCodeframe,sReserved,sEditableFrom,sEditableTo,sDecimal,sSetQfactor,sLogic_if,sLogic_then )
As you don't have default values in the constructor - you
should specify the parameters.
2. why do use type "string" ? It should be "String" if you
refer to a standard type
3. What are you trying to say by this:
public var Codeframe():string;
public var Logic_if():string;
public var Logic_then():string;
There should not be any parenthesis in the variable
declaration.
4.
this is wrong
var Question():Question=new Question();
this even wronger
var Question():Array=new Question(); // I'm trying to create
an array here anyway...could this be the problem??
no parenthesis!
var Qs():Question=new Question();
hmmmm....
.var Qs()=new Question();
I think you should start reading from the following link to
get more understanding of the variables, types & declarations:
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001863.html
Cheers,
Dmitri.

Similar Messages

  • Error when defining a variable  other than CHAR

    I am getting a syntax error when I define variables :
    data: l_arbei  type p.
    constants:  l_delim  type x  value '09'.
    Message L_ARBEI must be a character-type field (data type C, N, D or T). an open control structure introduced by "INTERFACE"
    Has anyone else experienced this problem.  Why can I not define these variables.

    data: l_arbei  type p decimals 1,
          l_ismnw  type p decimals 1.
      write w_ops-work_activity to l_arbei. 
      l_arbei = l_arbei - l_ismnw.          
      if l_arbei gt 0.                      
        write l_arbei to w_ops-work_activity.
      endif.
    As mentioned same error message when defining the following:
    constants:  c_delim  type x value '09'.
         split i_input1-line at c_delim into 
               w_hdr-orderid                 
               w_hdr-order_type.              
    I agree that there should be no problem with the definitions. However cannot understand why it does not like it.  Thought there might be an additional requirement for Unicode systems.

  • How to pass a variable from one class to another class?

    Hi,
    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • Moving Variable from one class to another.

    I need to get a Variable from one class to another how would I do this?

    Well this is a very tipical scehario for every enterprise application. You always create logger classes that generate log files for your application, as that is the only way to track errors in your system when its in the production enviorment.
    Just create a simple class that acts as the Logger, and have a method in it that accepts a variable of the type that you are are trying to pass; most commonly a String; but can be overloaded to accept constom classes. e.g.
    class Logger
      public void log(String message)
        writeToFile("< " + new Date() + " > " + message);
      public void log(CustomClass queueEvent)
        log("queue message was: " + queueEvent.getMessage() + " at: " + queueEven.getEventTime());
    }Hope this makes things clearer
    Regards
    Omer

  • Accessing public variables from other classes

    Probably a simple questions, but how can I access a variable from another class. My exact situation is as follows.
    A class called WorldCalender has a variable which is defined: public int hour; (the value is given to it elsewhere).
    I want to access this variable and increase it by one in a subroutine in the class Hour. In this class I have put: WorldCalender.hour++; but it doesn't seem to work. How should I do it?

    don't expose the hour variable at all.
    have a method eg addToHourBy( int hrs )
    Probably a simple questions, but how can I access a
    variable from another class. My exact situation is as
    follows.
    A class called WorldCalender has a variable which is
    defined: public int hour; (the value is given to it
    elsewhere).
    I want to access this variable and increase it by one
    in a subroutine in the class Hour. In this class I
    have put: WorldCalender.hour++; but it doesn't seem to
    work. How should I do it?

  • Error when defining successor for node 0000000198

    Hello ,
    We are using leave request service on ESS portal.
    From last few days we are getting error like " Error when defining successor for node 0000000198   "
    All agents are assigned properly and also v have checked PFTC setting for Workflow.
    the method which are using is Synchrounous.
    this error is nt coming perticulary for one employee but it is coming for sick leave workflow.
    Please help
    thanks

    Hi,
    This is a binding issue between the workflow container and the task 
    container because we can see the text in the workflow container but 
    it is empty in the task container.
    Our proposed solution is to go into the Dev or QAS environment and 
    regenerate the binding between the workflow and this particular task. 
    We will test and if this works, this will resolve issue.

  • Error when updating the data from DSO to cube

    Hi,
    I am getting the error when uploading the data from the ods to cube.
    The following is the error message.
    Unable to determine period for date 20090101, fiscal year variant Z2: Error #
    How can i solve this issue.
    Regards
    Annie

    Hi ,
    fiscal year variant, go into Customizing for Financial Accounting (FI) under Financial Accounting Global Settings >>>Fiscal Year >>>Maintain Fiscal Year Variant.
    check this link ..
    http://help.sap.com/saphelp_scm41/helpdata/en/50/0d89f2ad919c40b95b9ae7583c8c96/frameset.htm
    http://help.sap.com/saphelp_scm41/helpdata/en/50/0d89f2ad919c40b95b9ae7583c8c96/content.htm
    Regards,
    shikha

  • Error when determining  a number from object BI_ODS

    Error When determining a number from object BI_ODS and number 01  when flat file source system is assigned to transfer rules of infosource , when activating this error occured .
    plz need solution.

    Hi,
    Number ranges can be maintained through the transaction SNRO. For details check:
    http://help.sap.com/saphelp_nw70/helpdata/EN/2a/fa02e3493111d182b70000e829fbfe/frameset.htm
    Rgds-
    Sonal

  • Error when determining a number from object BI_TSDTEL and number 01

    Hi BW Experts,
    After Transporting Infosources (Master & Transaction) to BW QA, the transfer rules were not getting activated in QA. The following error message was diaplyed.
    "Error when determining a number from object BI_TSDTEL and number 01
    Object name can only contain characters from syntactical character set
    Object name can only contain characters from syntactical character set
    Data element for InfoObject KOKRS 0CO_AREA could not be created
    Data element for InfoObject KOKRS 0CO_AREA could not be created
    Transfer structure 0IM_FA_IQ_2_SB activated under the name 0IM_FA_IQ_2_SA
    It is not necessary to copy dependent objects for transfer structure 0IM_FA_IQ_2_SA
    Transfer structure 0IM_FA_IQ_2_SA does not exist
    Error RSAR 440 when handling objects with type R3TR ISTS."
    I have gone through the Note: 674818.
    Could someone clear me about BI_TSDTEl, By using this do we need to maintain object intervals manually in all the systems like BW ( Dev & QA ), R/3 (Dev & QA).
    Because  I have not seen the Intervals in R/3 ( Dev & QA) systems.
    please could someone provide Inputs for this.
    Thanks in Advance
    Regards
    SK

    Hi,
    Try to see that transfer structure is existing in the sytem which is connecting in
    the BW quality.
    You need the same to be transported from the development server of R/3 to quality server of R/3.
    Just check if this helps.
    Regards
    Rahul Bindroo

  • Short dump error when extracting delta records from R/3

    I am working on BW 3.5 and I am facing some short dump error when extracting delta records from the r/3 to BW.
    Below is the error message
    Kindly do the needful ASAP.
    Job started
    Step 001 started (program SBIE0001, variant &0000000024277, user ID BWREMOTE)
    Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    DATASOURCE = 0ISCM_PAYMENT_01
             Current Values for Selected Profile Parameters               *
    abap/heap_area_nondia......... 2000000000                              *
    abap/heap_area_total.......... 2000000000                              *
    abap/heaplimit................ 40000000                                *
    zcsa/installed_languages...... DE                                      *
    zcsa/system_language.......... E                                       *
    ztta/max_memreq_MB............ 2047                                    *
    ztta/roll_area................ 6500000                                 *
    ztta/roll_extension........... 2000000000                              *
    2,454 LUWs confirmed and 2,454 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DAT
    ABAP/4 processor: MESSAGE_TYPE_X
    Job cancelled

    Hi,
    I look at the transaction ST22 to see which type of error has given you. Take a look at the notes to correct the error.
    Another option is to look at OSS notes, because the error is giving you a standard extractor.
    Greetings,

  • Error when connecting to portal from some machines

    Hi all,
    Can anyone help me with this.
    I get this jserver error when connecting to portal from some
    client machines.
    I works fine from the others. Any ideas?
    This is the error I get:
    [08/01/2002 17:41:57:618 GMT+00:00] page/Timeout occurred,
    label=73 url=http://odeceixe:81/pls/portal30/!
    PORTAL30.wwpro_app_provider.execute_portlet time=15828ms
    [08/01/2002 17:41:57:618 GMT+00:00] page/ContentFetcher
    Unexpected Exception, name=content-fetcher5
    java.io.EOFException: Premature EOF encountered
         at HTTPClient.StreamDemultiplexor.read
    (StreamDemultiplexor.java, Compiled Code)
         at HTTPClient.RespInputStream.read(RespInputStream.java,
    Compiled Code)
         at java.io.InputStream.read(InputStream.java:95)
         at java.io.InputStreamReader.fill
    (InputStreamReader.java:163)
         at java.io.InputStreamReader.read
    (InputStreamReader.java:239)
         at oracle.webdb.page.ContentFetcher.run
    (ContentFetcher.java, Compiled Code)

    Did you ever find the cause of this, I am receiving the same message, but as you said, only when connecting to the portal via a certain pc.

  • Error when launching promoted app from RemoteAPP

    Hi:
    We are receiving this error when launching any application from RemoteAPP, we tried promoting Calculator, Notepad, etc. and received the same error as well.
    "Personalization:
    This theme can't be applied to the desktop.
    Try clicking a different theme"
    Help!
    Thank you,
    Stangride

    If you launch the app directly from the session hosts using the same account that your using with remoteapp what are you getting? Try and RDP to the session host when you attempt it. I would also check rsop.msc to see if you have any GPO or scripts that
    are manipulating themes.

  • More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library.

    I am able to pick 4 videos from the Photo library in my iPhoneAPP but when i try to pick 5th one it throws an error:
    "More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library."

    Hello Tate r Bulic
    I don't have any idea how to remove this error,can i pick more than 5 videos from the photo library...
    If it's then please help me and gimme idea..Thanks

  • Error when defining successor of node in workflows

    Hi Experts,
    I am receiving an error which says "error when defining successor of node XYZ". However in my workflow template, this particular XYZ node does not exists.
    Also I found one entry in SWP_SUSPEN table for the main workflow. I tried to execute the report manually RSWWERRE. Still it did not work out.
    I also tried to use transaction SWF_ADM_SUSPEND. However my workitem is not showing in the list.
    Kindly help me in this issue.
    Thanks
    Gopal

    Hi,
    This problem occurs because the nodes system table with respect to workflow is not updated properly. I hope you might have deleted or changed the workflow design after this you need to update the index of the workflow template too.
    Follow the below steps
    1. Execute PFTC choose task type as Workflow template and open in change mode.
    2. On menu goto Addtional Data ---> Agent Assignment ---> Maintain
    3. Choose the workflow template ID and click on the icon on the application tool bar with Red and white colur (Football ) i am not sure I think you can try with CTRL + F11 but you hvae to update the index.
    After doing this Execute SWUD txn Check for the consistencies of the workflow template. if you do not find any error refresh the buffer and org environment.
    Even after doing all this stuff you still face the issue then generate a version  just simply insert a dummy step in the workflow activate and then delete the dummy step activate and refresh the buffer and org environment and try to execute.
    This error ususally occurs (upto my knowledge) if the nodes table of the workflow is not updated properly, So the above mentioned  ways are to deal with it.
    Regards
    Pavan

  • Error when undate solution manager from 700 to 701(700 enp1)

    Hi all,
    error when undate solution manager from 700 to 701(700 enp1),error:OCS package SAPKITL428 does not match the current software component vector.
    My current supportstack is as follows :
    SAP_ABA 700 0016 SAPKA70016
    SAP_BASIS 700 0016 SAPKB70016
    PI_BASIS 2005_1_700 0016 SAPKIPYM08
    ST-PI 2008_1_700 0002 SAPKITLRD1
    SAP_BW 700 0018 SAPKW70018
    SAP_AP 700 0014 SAPKNA7014
    BBPCRM 500 0012 SAPKU50012
    CPRXRPM 400 0014 SAPK-40016INCPRXRPM
    ST 400 0017 SAPKITL427
    ST-A/PI 01L_CRM570 0000 -
    ST-ICO 150_700 0017 SAPK-1507KINSTPL
    ST-SER 700_2008_1 0005 SAPKITLOO5

    Hi,
    Because prerequisite to apply this package is not met. To apply this package below is the prerequisite which i can see in your package level is not met:
    Support Packages
    Package      Value
    SAPKU50012      T
    SAPK-70401INBICONT      T
    SAPK-40013INCPRXRPM      T
    SAPK-50001INCRMUIF      T
    SAPKA70102      T
    SAPKNA7012      T
    SAPKB70101      T
    SAPKB70102      T
    SAPK-701DHINSAPBASIS      T
    SAPKITL427
    Thanks
    Sunny

Maybe you are looking for