Idea of variables

Hello.
I like javafx scripting like JSON.
But I want to set some node to a variable.
For example:
Group {
    content: [
        SomeNode {}
        SomeNode {} // I want to set this node to 'var someNode';
}Two methods here.
one:
var someNode = SomeNode {};
Group {
    content: [
        SomeNode {}
        someNode
}two:
var g = Group {
    content: [
        SomeNode {}
        SomeNode {}
var someNode = g.content[1] as SomeNode;We will be happy if we can write this format.
Group {
    content: [
        SomeNode {}
        SomeNode {} as var someNode //
}Please let me hear the opinion.

You were close. A relatively common idiom is using the fact than an assignment has a value:
var someNode: SomeNode;
Group {
    content: [
        SomeNode {}
        someNode = SomeNode {}
}

Similar Messages

  • Using path variable to CI under transaction file for DBTABLOG archiving

    Hello Colleagues,
    I have to configure DBTABLOG archiving among others under transaction file.
    Here you have to configure archive path to the filesystem.
    E.g.this is the path to the development system:
    DEV23015\Interfaces\Outbound\Archiving_IDOCs\<FILENAME>
    It's clear, for test as well production we are using different hostname.
    So the consideration was to use a respective variable for the server system.
    E.g.
    <HOST>\Interfaces\Outbound\Archiving_IDOCs\<FILENAME>
    But now the problem, we are using CI (centra instnace) and application server for test as well as production and the archiving path respectively the archiving folder are only configured at CI server.
    So the HOST variable is not sufficient in this case.
    The variable SAPGLOBALHOST pointing directly to the CI server but not possible to configure under TC file.
    Any idea which variable possible and pointing direct to CI server?
    Or is the only possibility for pointing direct to CI server for archiving to use the HOST variable and modify the archiving job to run only on CI server?
    Many thanks in advance!
    Regards,
    Jochen

    You have two options...
    First one is to mount that path into all your instances
    Second is to use a Server Group Name under Cross-Archiving Object Customizing -> Technical Settings to force that particular object jobs to run on your CI.
    Regards
    Juan

  • How do I display variables in a query in Bex Analyser 7.0?

    Is this option gone in 7.0? I know I can insert navigation pane or filters, but how do I display what variables have been used to run a particular query?
    I run a query and there is no way of telling HOW I ran it... I am surely missing something here, no?
    Also, I know that SAPBExQueries sheet is gone in 7.0. I used it to override variables values and force query/workbook refresh with the new variables (as a way of automation of a report). How do I go about this in 7.0 if I don't even see the variables anywhere? What other way of forcing a workbook to refresh for, say, 10 different clients?
    Thanks,
    A.

    Jacob,
    Many thanks for your reply.
    As for Bex, you said:
    "So any query needs to start in a default workbook design where you got the filter and nav pane. Then you got a "Variables Screen" option."
    Regardless of whether I run a stand alone query, or I insert analysis grid, nav pane and filters in the design mode, my variables are not dislayed anywhere. What do you mean by "then you got a variables screen option"? Where is it? I checked toolbars, menus, properties, I couldn't find anything. I can, of course, change variables, if that's what you mean, but I still can't display them on my worksheet. So if somebody's looking  at my query they have no idea what variables I used. 
    As for broadcasting, sorry, it's not an option. By "say 10 clients" I meant "say 100 clients" times 20 different managers i.e. 200 different variants (seperate reports)  Not possible to use a broadcaster, I am afraid, as the list of  clients, managers and fiscal periods (and other variables) changes too often and we need to have the flexibility.
    By looking at the new 7.0 I fear we will need to stick to the version 3.5 for that reason. Worrying...
    Cheers,
    A.

  • Variable E is undefined

    Posted for one of our programmers:  Variable E is undefined ...but the error message only occurs on PROD servers, not DEV nor TEST.  Any ideas?
    Variable E is undefined.
    coldfusion.runtime.UndefinedVariableException: Variable E is undefined. at coldfusion.runtime.CfJspPage._get(CfJspPage.java:303) at coldfusion.runtime.CfJspPage._get(CfJspPage.java:283) at coldfusion.runtime.CfJspPage._autoscalarize(CfJspPage.java:1494) at coldfusion.runtime.CfJspPage._autoscalarize(CfJspPage.java:1471) at coldfusion.compiler.ExprClassLoader.evaluate(ExprClassLoader.java:139) at coldfusion.runtime.CFPage.Evaluate(CFPage.java:1749) at coldfusion.runtime.CFPage.IIf(CFPage.java:1740) at cfeditEmplHrngStgErr2ecfc230382607$funcDISPLAYEMPLSTGERR.runFunction(D:\JRun4\servers\94_ CFMX7\cfusion.ear\cfusion.war\cf\HCP\editEmplHrngStgErr.cfc:165) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:495) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:354) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:382) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2723) at cfdataMaintenance2ecfc1819247246$funcMAINCONTENT.runFunction(D:\JRun4\servers\94_CFMX7\cf usion.ear\cfusion.war\cf\HCP\dataMaintenance.cfc:179) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at cfdataMaintenance2ecfc1819247246$funcCONTROL.runFunction(D:\JRun4\servers\94_CFMX7\cfusio n.ear\cfusion.war\cf\HCP\dataMaintenance.cfc:28) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:490) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cffuseBox2ecfc736635438$funcFUSEBOX.runFunction(D:\JRun4\servers\94_CFMX7\cfusion.ear\cfu sion.war\cf\HCP\fuseBox.cfc:74) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:490) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cfindex2ecfm1106450115.runPage(D:\JRun4\servers\94_CFMX7\cfusion.ear\cfusion.war\cf\HCP\i ndex.cfm:8) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:342) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:87) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53) at coldfusion.CfmServlet.service(CfmServlet.java:201) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at com.intergral.fusionreactor.filter.FusionReactorFilter.c(FusionReactorFilter.java:428) at com.intergral.fusionreactor.filter.FusionReactorFilter.d(FusionReactorFilter.java:262) at com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java: 171) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    This doesn't really give us any information.  Do you have the stack to show us the executing templates and their respective lines?
    A variable named 'e' was referenced by ColdFusion, but never defined.  Find the line the error is occuring on, chances are that's the line that's referencing the variable, and then determine what the programmer intended to use.

  • Refer to multiple objects with 1 variable

    In general, how would one do that?
    In an object, I can declare a variable to be another object, but really I want to access multiple rawValues. 
    So if I have 2 fields, I'd like to have something like:
    var A = textfield1 ||
               textfield2;
    if (A.rawValue == null) {
    do something;
    In this example, there's no need to even use variables of course, but if I want to reference 200 fields, there has to be an efficient way of doing it (related to another question I asked about required fields).   Any ideas?  Variables are new to me-I've used some Form Variables, but I've set them equal to hard-coded numbers.
    Thanks!

    Hi,
    In relation to Form Variables, which are initially set in the File > Form Properties > Variables. You can set the value of the Form Variable (and get it) using the .value. So for example if the Form Variable was called myVariable, the following would apply:
    myVariable.value = 10; // Sets the variable
    app.alert(myVariable.value); // Would pop a message with 10
    That's not the issue here. I think the best route would be to put the 200 fields into a container/subform and then have script loop through the contents of the container/subform. Paul Guerette's LockAllFields is a great example of such a loop. There is an amended version of it here: http://assure.ly/yDtfsM.
    That cn be adapted to do anything with the objects, so it depends on what action you are after.
    Hope that helps,
    Niall

  • Variable Element as xsd

    Hi,
    I have a variable of type element based on a xsd. I populate the variable with a xml snippet and later on in the process I try retrieive individual elements but get the
    "bpws:getVariableData('UserAssetDefaults','/ns21:USERASSETDEFAULTS/ns21:processStatus')" is empty at line 297, when attempting reading/copying it. If I retrieve the entire variable this works and the xml document is copied. Any ideas?
    Variable definition
    ============
    <variable name="UserAssetDefaults" element="ns21:USERASSETDEFAULTS"/>
    Assigning variable
    ===========
    <copy>
    <from>
    <USERASSETDEFAULTS xmlns="http://sample.otn.com">
    <processStatus>APPROVE
    </processStatus>
    <reviewStatus>ON HOLD
    </reviewStatus>
    <bookTypeCode>CCDHB
    </bookTypeCode>
    <batchName>filename1
    </batchName>
    </USERASSETDEFAULTS>
    </from>
    <to variable="UserAssetDefaults"/>
    XSD
    ===============
    <?xml version="1.0" encoding="windows-1252"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://Asset/Defaults"
    targetNamespace="http://Asset/Defaults"
    elementFormDefault="qualified" >
    <xsd:element name="USERASSETDEFAULTS">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="processStatus" type="xsd:string"/>
                        <xsd:element name="reviewStatus" type="xsd:string"/>
                        <xsd:element name="bookTypeCode" type="xsd:string"/>
                        <xsd:element name="batchName" type="xsd:string"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    </xsd:schema>

    Assigning variable
    ===========
    <copy>
    <from>
    <USERASSETDEFAULTS xmlns="http://sample.otn.com">
    <processStatus>APPROVE
    </processStatus>
    <reviewStatus>ON HOLD
    </reviewStatus>
    <bookTypeCode>CCDHB
    </bookTypeCode>
    <batchName>filename1
    </batchName>
    </USERASSETDEFAULTS>
    </from>
    <to variable="UserAssetDefaults"/>
    When yuo make assign activity, you assign also namespace to variable.
    Try to use transform activity assign activity instead.
    After this bws:getVariableDate() will work.

  • Usage of SAPBEX setVariables method?

    Dear all,
    I have a question regarding the usage of the SAPBEXsetVariables method which is part of the SAPBEX VBA-API.
    I want to invoke a BEx Workbook from a VBA-Macro. The query, embedded in this workbook, is
    using variables. (Some of the variables are further being processed by user exit, once a value for these variables
    has been set.)
    When opening the Workbook from my VBA-Macro, I don't want the variable screen to pop up. The variables should be set automatically during runtime, e.g. read from a spreadsheet. No user interaction should be necessary (reason: I need to batch process some 100 variables, that means, my workbook is being invoked a 100 times).
    The method SAPBEXSetFilterValue does not work in this scenario, because of the above mentioned variable processing by user exit.
    I thought, the SAPBEXsetVariables(varValues As Range) method might be the solution. Unfortunately, I couldn't find out, how to handle this method.
    I understand, that the method is reading the variables and their respective values from an Excel Range object.
    But I have no idea how variables and values need to be arranged within the range object.
    Any help on this topic? Am I on the right track at all?
    Thanks in advance.
    Kind Regards,
    Yogen Weinreich

    Hi Pete,
    > I don't know if you are still following this thread,
    > but I came back to this problem a few days ago and I
    > now have the solution to the SAPBEXsetVariables
    > method.
    Yes, I am still following this thread as well as other threads on SAPBEX VBA in this forum. That's how I came across the thread named <i>suppress variable-entry-window (SAP-Exit)</i> which is dealing with the same problem. The answer you are giving there regarding those two hidden repo sheets is rather impressing and was helpful to me in solving our problem.
    I our solution, we are actually not using the setVariables() method at all. Instead, we are directly writing the
    variable values in the respective cells of column GE/187 on the hidden "SABBEXqueries" sheet. This works fine for us.
    I'm facing a different problem though: We have been developing and running our solution from a local PC. The
    problem is, that we need to upload the BEx-Workbook  containing the VBA-Code to the SAP server. But there
    seems to be a naming conflict with the SAPBEX library, which needs to be referenced by the VBA modules we developed and a module also named SAPBEX, which is containing the SAPBEXonRefresh() event/procedure.
    Whenever we want to insert the SAPBEX library (in the menu bar of the VBA editor select Extras - References) a message window pops up, saying that there is a naming conflict between this library and an existing project or module. If I delete the SAPBEX module (the one containing the above mentioned event) I am able to insert the SAPBEX library. But when I save this very workbook to the SAP server, close it and try to open it again, I get an error message saying something about a "Runtimerror '5':
    Invalid procedure call or invalid argument". I guess, it's because of the SAPBEX module I deleted.
    Any suggestions on this one?
    > I like it better than the alternative solution that I
    > was suggesting last month.
    > So, when you're ready to have a go at it again, I can
    > give you the details.
    Sure, I'd definitely be interested. Is it the one you gave to Armin Weh in this thread?
    BTW, since you were asking, we are using Release 3.5.
    Regards,
    Yogen
    P.S. Pete, as you can see, there is still interest in this subject and your help is really being appreciated.
    I haven't really figured out, how the reward point systems works in this forum, but you have definitely earned yours.

  • CF Component work on local computer but not on actual web.

    I'm using CF9 on windows 7 professional. when ever i execute from a form to the action page i get this error:
    Could not find the ColdFusion component or interface VAFOINS_NEW.Componet.display. Ensure that the name is correct and that the component or interface exists.
    It works fine on my local computer, however the Componet is not invoking properly when on the actual web. Any suggestions?
    THE CFC syntax is below:
    <!--- Generated by Adobe Dreamweaver CS5 11.0.4.4993 [en] (Win32) - Fri Sep 23 2011 15:56:13 GMT-0400 (Eastern Daylight Time) --->
    <cfcomponent displayName="volno" hint="List all FCN, NS, FOID etc. Items By way of volno input">
    <cffunction name="volno" returntype="query">
    <cfquery name="volno"> select TRIM(CONCAT(name.fname,' ',name.xholy))AS Brother, name.foiid, fcn.*, nspay.*, Foidpay.*, otherpay.*, CONCAT(otherpay.othpayamt,' - ',otherpay.othpaytitle) AS otherpay, fcnsales.salesid,(fcnsales.salesamt) AS FCN_SOLD, salesdate
    FROM name, fcn, fcnsales, foidpay, nspay, otherpay
    WHERE 0=0
    AND Fcn.fcnvolno = '#form.volno#'
    AND name.foiid= fcnsales.salesfoiid
    AND FCN.fcnid= fcnsales.salesfcnid
    AND name.foiid= nspay.NSPAYfoiid
    AND nspay.nspaydate= fcnsales.salesdate
    AND name.foiid= FOIDPAY.foidpayfoiid
    AND FOIDPAY.foidpaydate= fcnsales.salesdate
    AND name.foiid= otherpay.othpayfoiid
    AND otherpay.othpaydate= fcnsales.salesdate
    ORDER BY name.city desc, name.foiid
    </cfquery>
    <cfreturn "#volno#">
    </cffunction>
    <!---NEW FUNCTION--->
    <cffunction name="total" returntype="query">
    <cfquery name="total">
    SELECT name.*, fcn.*, sum(fcnsales.salesamt) AS FCN_SOLD_This_Issue, salesdate
    FROM name, fcn, fcnsales
    WHERE 0=0
    AND Fcn.fcnvolno = '#form.volno#'
    AND name.foiid= fcnsales.salesfoiid
    AND FCN.fcnid= fcnsales.salesfcnid
    </cfquery>
    <cfreturn "#total#">
    </cffunction>
    <!---NEW FUNCTION--->
    <cffunction name="total_NS" returntype="query">
    <cfquery name="total_NS">
    SELECT SUM(nspay.nspayamt) AS total_ns
    FROM nspay
    WHERE 0=0
    AND nspay.nspayvolno= '#form.volno#'
    </cfquery>
    <cfreturn "#total_NS#">
    </cffunction>
    </cfcomponent>
    My action page which invokes the cfc has the code below:
    <cfinvoke
      component="VAFOINS_NEW.Componet.display"
      method="volno"
      returnvariable="volno">
    <!--- CFC Query --->
    </cfinvoke>
    <cfinvoke
      component="VAFOINS_NEW.Componet.display"
      method="total"
      returnvariable="total">
    <!--- CFC Query --->
    </cfinvoke>
    <cfinvoke
      component="VAFOINS_NEW.Componet.display"
      method="total_NS"
      returnvariable="total_NS">
    <!--- CFC Query --->
    </cfinvoke>
    <cfquery name="total_FOID" >
    SELECT SUM(foidpay.foidpayamt) AS total_foid
    FROM foidpay
    WHERE 0=0
    <!---AND foidpay.foidpaycity='richmond'--->
    AND foidpay.foidpayvolno= '#form.volno#'
    </cfquery>
    <cfquery name="total_other" >
    SELECT SUM(otherpay.othpayamt) AS total_other
    FROM otherpay
    WHERE 0=0
    <!---AND otherpay.othpaycity='richmond'--->
    AND otherpay.othpayvolno= '#form.volno#'
    </cfquery>
    <cfquery name="total_FOIClass_Attendance" >
    SELECT COUNT(CLASSFOIID) AS foic_attendance
    FROM foiclass
    WHERE 0=0
    <!---AND foiclass.classcity='richmond'--->
    AND foiclass.classvolno= '#form.volno#'
    </cfquery>
    <cfquery name="List_Class_Attendance" >
    select trim(CONCAT(name.type,': ',name.fname,' ',name.xholy,' ',name.slave))AS Brother, name.foiid, foiclass.classfoiid FROM name LEFT JOIN foiclass ON foiclass.classfoiid= name.foiid WHERE foiclass.classvolno='#form.volno#' order by name.type, brother
    </cfquery>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>VOL NO Results</title>
    </head>
    <body>
    <!---CFML Below--->
    </body>
    </html>

    My guess is a problem with the dot path notation. I'm always fighting with this. Most likly your local computer is using a virtual directory named VAFOINS_NEW (http://127.0.0.1/VAFOINS_NEW/) and your production site points directly to the VAFOINS_NEW directory (http://somesite.com/). On your live site the dot path notation you are using is expecting http://somesite.com/VAFOINS_NEW/. Dot paths are a pain and whoever invented them should retire as he or she has done enough damage.
    I usually do something like this (I'm typing from memory so there will most likely be syntax error or two but hopefully you'll get the idea):
    <cfset variables.dotpath="" />
    <cfif listFindNoCase(cgi.script_path,"VAFOINS_NEW","/")>
         <cfset variables.dotpath="VAFOINS_NEW." />
    </cfif>
    <cfinvoke component="#variables.dotpath#Componet.display"... />

  • Cannot cast from SOMETHING to SOMETHING (Error in 1.4) (Works in 1.6)

    Our company have developed an accounting program, and it is already near completion.
    We developed it with JavaBean and Eclipse in Windows Environment with JRE 1.6.0_05
    When we tried to compile and run the program in our linux environment (Server) that runs on 1.4 , the casting error occured..
    we have written a program to generate all casting errors that occurred in our project.
    import java.math.*;
    import java.util.*;
    public class testnow {
         public static void main(String[] args){
              //Declare ALL Primitive!
              int TestINT = 150;
              Boolean TestBOOL = true;
              String TestSTR = "Streng" + "th";
              BigDecimal TestDCM = BigDecimal.valueOf(20);
              Date TestDATE = new Date();
              //Declare ALL Object
              Object TestINTObj = 150;
              Object TestSTRObj = "Strength";
              Object TestDCMObj = BigDecimal.valueOf(20);
              Object TestBOOLObj = true;
              Object TestDATEObj = new Date();
              if(TestINT == (Integer)TestINTObj){
                   System.out.println("TEST Integer PASSED");
              if(TestSTR.equals((String)TestSTRObj)){
                   System.out.println("TEST String PASSED");
              if(TestDCM.equals(TestDCMObj)){
                   System.out.println("TEST Decimal PASSED");
              if(TestBOOL == (Boolean)TestBOOLObj){
                   System.out.println("TEST Boolean PASSED");
              if(TestDATE.equals((Date)TestDATEObj)){
                   System.out.println("TEST Date PASSED");
    }the following is what happened when i run javac testnow.java
    1. ERROR in testnow.java
    (at line 6)
    Integer TestINT = 150;
    ^^^^^^^
    Type mismatch: cannot convert from int to Integer
    2. ERROR in testnow.java
    (at line 7)
    Boolean TestBOOL = (Boolean)true;
    ^^^^^^^^^^^^^
    Cannot cast from boolean to Boolean
    3. ERROR in testnow.java
    (at line 11)
    Object TestINTObj = (Object)150;
    ^^^^^^^^^^^
    Cannot cast from int to Object
    4. ERROR in testnow.java
    (at line 14)
    Object TestBOOLObj = true;
    ^^^^^^^^^^^
    Type mismatch: cannot convert from boolean to Object
    4 problems (4 errors)
    in our windows development JRE 1.6 , it run well and gives the following output :
    TEST Integer PASSED
    TEST String PASSED
    TEST Decimal PASSED
    TEST Boolean PASSED
    TEST Date PASSED
    how do we solve this? i mean we have been using this "convenience" casting all over our code . :(
    please help
    thanks a lot.
    Cheers and God Bless,
    Chowi

    You've got a lot of problems there, and not all of them are due to Java version incompatibilites. I'll take them in the order I see them. public static Object FindDataInTable(ArrayList TargetTable, String TypeColumn,
             String TargetColumn, Object TargetData, String ReturnedColumn)&#x7B; The convention is to give methods and variables names that start with lowercase letters. That makes your code easier to read, which makes it easier for us to help you. Later on, I see you also use a mix of underscores and camelcase. Underscores should be used only in constant names; class, method and variable names should use only camelcase.
    Also, if you don't have a good reason to make that first argument an ArrayList, you should declare it as a List instead. That leaves the calling code the option of using a different List implementation should they need to.
    Next, you assign a primitive value to an Object reference: Object ReturnedObject = 0; That requires autoboxing, as others have pointed out, which didn't exist in JDK 1.4. Even if you could use autoboxing though, that assignment would be a bad idea; a variable of type Object should be assigned a default value of {color:000080}null{color}, not a number. However, you may not need to declare that variable at all, as I explain later.
    Next you use a "foreach" loop, another feature that was added in JDK 1.5; you'll have to switch to the old-style loop if you want this code to work under JDK 1.4. While you're at it, you should declare your "SingleRow" variable inside the loop, since it's not used anywhere else: for (Iterator it = TargetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next(); Next I see you using matches() to compare String values: if(TypeColumn.matches("String")){
        if(((String)TargetData).matches((String)CheckData))&#x7B; You get away with that because the strings contain only letters, but you need to look up the docs for matches() so you'll understand why you shoudn't be using it here. But this is nothing compared to the next issue: if((Integer)TargetData == (Integer)CheckData)&#x7B; // WRONG WRONG WRONG That can't possibly have worked right, no matter what version of Java you ran it under. You NEVER use == to compare the values objects! You should have been using equals() for all those comparisions, not matches(), and definitely not ==.
    But I don't see why you're doing all those checks on the column type anyway. All you ever do after that is compare the same two values, so just do it: for (Iterator it = targetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next();
        Object CheckData = SingleRow.Get_object(TargetColumn);
        if (CheckData != null && CheckData.equals(TargetData)) {
            return SingleRow.Get_object(ReturnedColumn);
    } If there are other columns that you're supposed to ignore, you may still need to check the column type, but you could do that in one {color:000080}if{color} statement; you don't have to check them all separately.

  • Having trouble showing an Iview in a HTML page with frames format

    Hi, I have a public webpage with 3 frames (top, navigation and content)
    In the content part has to be showed a portal anonymous page.
    I created the anonymous portal page that shows me a Webdynpro that I created, works fine. But when I put the link in the frame of the public webpage, is like the page entered in a loop and nothings is showed.
    But if in the frame I put the direct Webdynpro link works fine but the Custom colors that I set in portal doesnt works (and this is important).
    Any1 know how can I do to put an anonymous portal page inside a frame html without lossing the colors that I replace in the theme editor.

    sun1977 wrote:
    Hi,
    I have the Home page which has the usual static text. I was looking for the option of showing some data on that page like
    1. last data load date which will have to be selected from the database. Do we just create a dynamic action on the HTML page? Going to try this now. But just wondering if there is a proper way to do this?
    Just to be a little more specific. I have static text in <Table> tags in a plain HTML page. So within the <TABLE> tags which is in the text source, Can I call bind values or PL/SQL procedures?. Was looking for some ideas on this.There are several options. One is to create hidden page or application items set using queries in item source, computations or processes. These can be referenced in HTML region source (and other places) using the static text exact substitution notation:
    &P1_ITEM.Another is to replace the HTML region with a report region using a custom report template. If there are a number of related values to display this is likely to perform better as only one query is involved.
    Unless these values respond dynamically to changes on the page there is no call to use Dynamic Actions.
    2. Insert the audit field with the SSO username. Any idea which variable stores the username which maybe can be passed to the trigger to update before an insert/update.Use the built-in <tt>APP_USER</tt> substitution string. For this purpose normally in a database trigger including a fall-back value to cope if the table is modified outside of your APEX app:
    :new.modified_by := nvl(v('app_user'), user);

  • Newbie - What is OO?

    Hi there. I am doing programming using Java, thanks for some help and hope to get some more!
    I am in semester 2 now at uni, and having a panic attack - I may fail :(
    The thing is, I love programming, done it for a long time, self taught and taught by some people even at school etc...
    But, I need to know, can't find it anywhere - What is Object Orientated programming in Java? (OO)?????
    What does it mean? What does it do and what are the benifits?
    Thanks a lot for any replies!

    You seemed to have missed the part about ojbects having state and behavior. That addresses your ideas of variables and interaction. OO is just a way of looking at problems that decomposes them into objects and interactions among/responsibilities of objects, rather than decomposing problems into tasks, as functional programming does.
    Google for OO and I am sure you'll find more resources than you know what to do with.
    Good luck
    Lee

  • Comparison Program

    I am trying to write a program that reads 5 integers and displays the highest and lowest integers typed in. We are only supposed to use the ideas of variables and comparison operators. The way I figured does this is create a variable named maxVar and keep reassigning it if some other variable ends up being larger. What am I doing wrong. I am new to java
    public class Comparison
    public static void main( String args[] )
             { // start main method
          Scanner input = new Scanner( System.in );
            int number1; // first number to compare
            int number2; // second number to compare
            int number3; // third number to compare
            int number4; // fourth number to compare
            int number5; // fifth number to compare
            int maxVar = 0; // This is the MaxValue
            System.out.print( "Enter First Integer: " );
            number1 = input.nextInt();
            System.out.print( "Eneter Second Integer: " );
            number2 = input.nextInt();
            System.out.print( "Enter Third Integer: " );
            number3 = input.nextInt();
            System.out.print( "Enter Fourth Integer: " );
            number4 = input.nextInt();
            System.out.print( "Enter Fifth Integer: " );
            number5 = input.nextInt();
            if ( number1 <= number2 )
                    number2 = maxVar;
            if ( number1 > number2)
                    number1 = maxVar;
            if ( number3 >= maxVar )
                    number3 = maxVar;
           if ( number4 >=  maxVar )
                    number4 = maxVar;
            if ( number5 >=  maxVar )
                    number5 = maxVar;
            System.out.print( " The maximum Integer You Entered Was:"  );
            System.out.printf("%d /n", maxVar );
            } // end method main
    } // end class Comparison

    What is wrong with the answers you got in your other thread?
    http://forum.java.sun.com/thread.jspa?threadID=764850&messageID=4362380#4362380

  • RRDTool installation failures

    Hey Alex (yes, I admit that this question is directly solely at you...might as well start sending me a bill)--
    Now that I've updated most of the servers under my purview to SpamAssassin 3.3.0 as well as Amavis-new 2.6.4, I thought I'd tackle the next most desired item on my list-- logging/graphing of the filtering stats. So, I started off attempting to install rrdtool w/ the hopes of adding MailGraph after that. I tried on a PPC G4 Leopard Server and a Mac Pro Snow Leopard Server, but had failures w/ rrdtool (different failures, I think) on each.
    The G4 (10.5) fails at the configure command, complaining about not finding the libpng library, despite libpng12 being in the /usr/X11R6/include directory.
    The Mac Pro (10.6) won't get past the long MACOSXDEPLOYMENTTARGET=10.6 line. When it fails, it says:
    checking for C compiler default output file name... configure: error: C compiler cannot create executables
    See `config.log' for more details.
    I've looked in this log file, but it is long, and I'm not sure what I'm looking for. Anyway, on both systems I have current (or near-current) Xcode Tools, and have gone back and installed X11 prior to stepping through your guides. I am, of course, using the proper 10.5 or 10.6 guides, depending on machine.
    I would try downloading and installing libpng manually on the G4, but I have no earthly idea what variables you give it (or why). Any suggestions?
    Thx,
    FT

    Well, out of 4 OS X Leopard 10.5 servers I've tried so far, only 1 has been successful. The rest give the following +configure error+ upon running the configure command under "4. Installing RRDtool" in the tutorial:
    * I could not find a working copy of libpng. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libpng and its header files. If you have not installed libpng, you can get it either from its original home on
    http://prdownloads.sourceforge.net/libpng/
    You can find also find an archive copy on
    http://oss.oetiker.ch/rrdtool/pub/libs
    The last tested version of libpng is 1.2.10.
    LIBS=-lz -lartlgpl2
    LDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib
    CPPFLAGS=-I/usr/X11R6/include/libpng -I/usr/X11R6/include/freetype2 -I/usr/local/lib I/usr/local/include/libart-2.0 -I/usr/local -I/usr/X11R6 -DTHREADSAFE -I/usr/include/libart-2.0
    Each of these servers is 10.5.8 w/ the latest patches; each has Xcode 3.1.4 installed, as well as X11 client. Is there something I can do to install libpng properly, or is this error message inaccurate?
    As far as the 10.6 server I mentioned, I tried it again, and yes, I was running as root. Still the same error there. It is v10.6.2 & Xcode 3.2.1 (latest).
    Add'l questions: there are far newer versions of RRDtool than 1.2.23...should any of those be used? Also, the 1 server I got it working on seems to show a multiple of the actual messages sent/rec'd. IOW, I send 2 test messages, and it shows 2 messages sent and 4 rec'd, or something like that. Is it reading from 2 places or reading the log entries twice?
    Thanks for the tips!
    Fred

  • Getting the name of an instance

    Hi,i`m having problems saving the name of an instance to a String variable.
    For example if i`ve written the following code:
    String s;
    A b = new A( );
    i`d like somehow the name of the instance(character b) to be stored to the String variable s.If anyone knows any method or way to do this please help,thanks.

    The variable is just a reference to the object. The object has no idea which variables you put it into.
    To give an object a name I pass a String to it and implement a getName() method.
    However it sounds like what you are trying to do might be done by a debugger. Are you trying to see what the values of your data are when it is running? If so use a debugger. The one which comes with NetBeans and Eclipse is free.

  • Web services and crossdomain.xml HELP

    Hello
    I am using the web services connector to consume a service it
    all works
    fine in flash however in the browser it fails
    I can see it trying to load crossdomain.xml at the domain of
    the WS
    provider this is despite my putting:
    System.security.loadPolicyFile("
    http://dev.chatham.site/crossdomain.xml");
    frankly I am at a loss as to how to make this work I have
    tried.
    var allowpath = "
    http://www.postcoderwebsoap.co.uk";
    System.security.allowDomain(allowpath);
    how the hell do you let the connector connect?
    any insight would be greatly apreciated
    Rich

    tjacobs01 wrote:
    Hi all,
    This is a follow-up to the question I posted and answered myself yesterday.
    I have created a web service that returns Hebrew words in a string format of an XML document. This all appears to be working fine at this point. The only problem is that when I'm debugging in NetBeans, certain hebrew characters/words (note: some characters / words work!) xerces gives me an invalid utf-8 string (byte 1 of 2) exception in the display of the SOAP response - not the response itself, but I think in whatever netbeans is doing to display it. Not sure i follow. Are you referring to the debugger screens where the IDE shows variables/stacks etc? If so, i would say not to worry too much. IDE's are not perfect.
    I have tried testing the strings I am returning by themselves - xerces can parse when I save them into a file and load. So it seems like the problem is just with the >SOAP response / with netBeans.
    I understand that returning XML within a SOAP container could then be screwing up the parsing. Any thoughts as to why certain words and not others? Is there any way to fix this, and perhaps more importantly - is it important to fix this?Did you test this in a production like environment? If so, i would say its just a minor annoyance.

Maybe you are looking for

  • Playing movies from ipod touch to hd tv

    widescreen movies have the sides cutoff.......... any one else have this problem.... or..... the solution??

  • #0000# code not working and a little review on the...

    Hi Guys! First of all, I was told that the code #0000# told you what version of FirmWare you have..... well whenever I try EVEN in a 3.5G internet connection/signal it goes: Requesting (loading) Request not complete (info icon) Can anyone help??? Als

  • No digital sound through digital-out coxial

    Hello, first my config : msi kt3ultra-ARU Athlon XP1800+ 1x256mb DDR RAM 2x80GB IBM Raid 0 (great performance !!!) 1x40 GB IBM HDD 1x LG CD-Writer 1x TEAC 32x CD-ROM no my problem : i connected my yamaha sorround receiver through the digital out of t

  • Purchased cash and lost reciept?

    I'm wondering if Best Buy saves the warrany information for an iPad through serial number and if they are able to pull it up because I have an iPad 1 and i paid cash for the warranty but since the screen is now burning in I wanted to know if without

  • Access list hit counts

     Hello Mates, Am getting a very rare type problem while I implement the aCL on 3850 switch I do get hit matches when I put a log keyword in the ACL 102 SW#sh ip access-lists Extended IP access list 102     5 permit tcp 192.168.0.0.0 0.0.255.255 196.1