How do I write this as a loop?

How do I write this code to function as follows.
When btn1 is clicked, SenderLoad should be "clay" AND when btn2 is clicked, SenderLoad should be "iron", etc...
var mgB:Array = [btn1, btn2, btn3, btn4];
var mgBW:Array = ["clay", "iron", "cotton", "leather"];
var SenderLoad:LoadVars = new LoadVars();
var ReceLoad:LoadVars = new LoadVars();
var mgNum:Number=0;
for (i=0; i<mgBW.length ; i++){
mgBW[i].onRelease = function () {
mgNum++
SenderLoad.word = mgB[mgNum];
SenderLoad.sendAndLoad("http://www.web.com/my.php",ReceLoad,"POST");
ReceLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
ldrB2.html=true;
for(var i:Number=0; i<messageA.length; i++){
           var a:Array=messageA[i].split(",,");
   ldrB1.htmlText +=a[0];
   ldrB2.htmlText +=a[1];

if you want different words in different colors you can use:
ldrB1.html=true;
ldrB1.text = formatF("REJECT",0xff0000,ldrB1)
ldrB1.text = formatF("ACCEPT",0x000000,ldrB1);
ldrB1.text = "formatF("BANNED",0xc0c0c0,ldrB1);
function formatF(s:String, col:Number, tf:TextField):Void {
if(tf.text.indexOf(s)==-1){
return;
    tfor.color = col;
    var startindex:Number = 0;
    while (startindex>-1 && startindex<tf.text.length-1) {
        var bindex:Number = tf.text.indexOf(s, startindex);
        var eindex:Number = bindex+s.length;
        tf.setTextFormat(bindex,eindex,tfor);
        startindex = eindex;
var tfor:TextFormat = new TextFormat();

Similar Messages

  • How can i write this C-Code in G-Code

    hallo
    how can I write this C-Code in LabVIew ,
    for a=0; a=<10; a++
       for b=0; b=5 ; b+2
            X= 3+b;
      Y=1+a;
    please see the attachment and tell me where is the problem
    Attachments:
    Unbenannt 11.vi ‏43 KB

    Well, at least you tried and got some of it right.
    I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
    In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
    Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
    To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
    Try to take over the world!
    Attachments:
    C.png ‏4 KB

  • List v = new Vector() how can i write this ?

    List v = new Vector() how can i write this ?
    vector does not 'extends' List rather it 'implements' only ......so how can write this way ? ( polymorphism applies only for 'extends' ).

    my question in a simple way is :
    List some_list extends Vector
    No, List is an interface; Vector is a concrete class. Read the javadocs.
    Vector implements List
    >
    AND
    List some_list implements Vector
    are these two same in behaviour
    our  apart from theoretical differences ?thanks
    Interfaces don't have any implementation; they're pure method signatures. When a concrete class implements an interface, it makes a promise that says "I will provide implementations for exactly these methods. Any client can call a method from the interface and I will do something 'sensible' if I'm written correctly."
    From the point of view of static and dynamic types, there's no difference between interfaces and classes.
    C++ has interfaces, too - they're classes with all pure virtual methods. If you understand how C++ works, the concept shouldn't be hard.
    ArrayList is preferred precisely because it isn't synchronized by default. (You can always make it so using java.util.Collections if you wish later on.) If you don't need synchronization, why pay the performance penalty?

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • How to re-write this big SELECT Query with INNER JOINs?

    Hi Experts
    I have a performance killer SELECT query with an inner join of 3 tables u2013 VBAP, VBAK and VBEP together, which populates records to an internal table INT_COLL_ORD. Based on these records selected, in another SELECT query, records are fetched from VBUK table to the internal table INT_VBUK.
    SELECT A~VBELN A~POSNR A~MATNR A~KWMENG A~KBMENG A~ERDAT A~ERZET A~PSTYV D~AUART E~ETTYP E~EDATU
    INTO TABLE INT_TAB_RES
    FROM VBAP AS A INNER JOIN VBAK AS D
    ON D~VBELN EQ A~VBELN AND D~MANDT EQ A~MANDT
    INNER JOIN VBEP AS E
    ON E~VBELN EQ A~VBELN AND E~POSNR EQ A~POSNR AND E~MANDT EQ A~MANDT
    WHERE  A~VBELN IN s_VBELN AND
           D~auart in s_auart AND
           D~vkorg in s_vkorg AND
           D~vbtyp eq 'C'     AND
           ( ( matnr LIKE c_prefix_sp AND zz_msposnr NE 0 AND kbmeng EQ 0 )
           OR ( matnr LIKE c_prefix_fp AND kwmeng NE A~kbmeng ) ) AND
           A~ABGRU EQ SPACE AND
           A~MTVFP IN R_MTVFP AND
           A~PRCTR IN R_PRCT AND
           E~ETENR EQ '1'.
    SORT INT_COLL_ORD BY VBELN POSNR ETTYP.
    DELETE ADJACENT DUPLICATES FROM INT_TAB_RES COMPARING VBELN POSNR.
    CHECK NOT INT_TAB_RES [] IS INITIAL.
    SELECT VBELN UVALL CMGST INTO TABLE INT_VBUK
    FROM VBUK FOR ALL ENTRIES IN INT_TAB_RES
    WHERE VBELN = INT_TAB_RES-VBELN AND UVALL NE 'A'.
    Now, the requirement is:
    I want to split this query. Like, first join VBAK and VBUK first. With this selection, go to the inner join of VBAP and VBEP (on key VBELN) to get the results. How can I re-write this Query?
    Please help.
    Thx n Rgds

    Hi Nagraj
    As of your suggestion, I have re-written the query as below:
    * Declarations
    TYPES: BEGIN OF TYP_COLL_ORD,
            VBELN  LIKE VBAK-VBELN,
            POSNR  LIKE VBUP-POSNR,
            MATNR  LIKE VBAP-MATNR,
            KWMENG LIKE VBAP-KWMENG,
            KBMENG LIKE VBAP-KBMENG,
            ERDAT  LIKE VBAK-ERDAT,
            ERZET  LIKE VBAK-ERZET,
            PSTYV  LIKE VBAP-PSTYV,
            AUART  LIKE VBAK-AUART, u201Calready exists in type
            ETTYP  LIKE VBEP-ETTYP,
            EDATU  LIKE VBEP-EDATU.
    TYPES: END OF TYP_COLL_ORD.
    DATA: INT_COLL_ORD TYPE TABLE OF TYP_COLL_ORD WITH HEADER LINE.
    TYPES: BEGIN OF TYP_VBUK,
            AUART  LIKE VBAK-AUART, u201Chave added this field
            VBELN  LIKE VBUK-VBELN,
            UVALL  LIKE VBUK-UVALL,
            CMGST  LIKE VBUK-CMGST.
    TYPES: END OF TYP_VBUK.
    DATA: INT_VBUK TYPE TABLE OF TYP_VBUK WITH HEADER LINE.
    *QUERY#1 u2013 for VBAK & VBUK Join
    SELECT A~AUART B~VBELN B~UVALL B~CMGST
    INTO TABLE INT_VBUK
    FROM VBAK AS A INNER JOIN VBUK AS B
    ON A~VBELN EQ B~VBELN
    WHERE A~VBELN IN s_VBELN AND
    A~auart in s_auart AND
    A~vkorg in s_vkorg AND
    A~vbtyp eq 'C' AND
    B~UVALL NE 'A'.
    IF NOT INT_VBUK[] IS INITIAL.
    SORT INT_VBUK BY VBELN.
    DELETE ADJACENT DUPLICATES FROM INT_VBUK COMPARING VBELN.
    *QUERY#2 u2013 for VBAP & VBEP Join
    SELECT A~VBELN A~POSNR A~MATNR A~KWMENG A~KBMENG A~ERDAT A~ERZET A~PSTYV B~ETTYP B~EDATU
    INTO TABLE INT_COLL_ORD
    FROM VBAP AS A INNER JOIN VBEP AS B
    ON B~VBELN EQ A~VBELN AND B~POSNR EQ A~POSNR AND B~MANDT EQ A~MANDT
    FOR ALL ENTRIES IN INT_VBUK
    WHERE A~VBELN = INT_VBUK-VBELN AND
    ( ( matnr LIKE c_prefix_sp AND zz_msposnr NE 0 AND kbmeng EQ 0 )
    OR ( matnr LIKE c_prefix_fp AND kwmeng NE A~kbmeng ) ) AND
    A~ABGRU EQ SPACE AND
    A~MTVFP IN R_MTVFP AND
    A~PRCTR IN R_PRCT AND
    B~ETENR EQ '1'.
    ENDIF.
      SORT INT_COLL_ORD BY  VBELN POSNR ETTYP.
      DELETE ADJACENT DUPLICATES FROM INT_COLL_ORD
        COMPARING VBELN POSNR.
      CHECK NOT INT_COLL_ORD[] IS INITIAL.
      LOOP AT INT_COLL_ORD.
        CLEAR: L_MTART,L_ATPPR,L_ETTYP.
        IF L_PREVIOUS_ETTYP NE INT_COLL_ORD-ETTYP OR
          L_PREVIOUS_AUART NE INT_COLL_ORD-AUART.
          READ TABLE INT_OVRCTL WITH KEY AUART = INT_COLL_ORD-AUART ETTYP = INT_COLL_ORD-ETTYP.
          CHECK SY-SUBRC NE 0.
    Now, the issue is:
    Please note that declaration for INT_COLL_ORD has a field AUART, which is used in further parts of program (see the statement just above)
    But, since neither VBAP nor VBEP contains AUART field, it cannot be fetched through the QUERY#2. So this value is not populated into INT_COLL_ORD through SELECT Query.
    Since this field is used in later part of program & that the internal table has no value for this field, it dumps!!
    How to include this value into the INT_COLL_ORD?
    Plz suggest....

  • How could I write this in java

    I have to use a parameter in a statement. I am trying but its giving error. I am trying to write it like ....
    fw.write("Object     dir/my.dat\n");I substitute my.dat with a variable dat & write like
    fw.write("Object     dir/+"dat"+\n");dat is a String variable.

    Sam_Fin wrote:
    thanks,welcome
    How could I remove this error.
    Unreported exception java.io.IOException; must be caught or declared to be thrown fw.write("#the number of patterns to be recognized\n");
    Its for every fw.write statement.read the Sun (Oracle?) [tutorial on exceptions,|http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html] and then either throw the exception or wrap in a try / catch block (the tutorial will explain how).

  • How would I write this query

    [USERNAME]
    [GROUP]
    User1
    New Member
    User2
    New Member
    User1
    All Members
    User1
    Gold Member
    How would I write a query so that I could select * from the above table where a user has more than 1 group (user1) and if one of the groups = 'All members' then ignore that row and just return the all the other rows for the user that has > 1 group. 
    Thanks in advance.  I can write the query for counting if a user has more than 1 group, but I stuck on the rest.
    Thanks again

    Try this
    declare @tab table(USERNAME varchar(10), Usergroup varchar(15));
    insert into @tab values
    ('User1','New Member'),
    ('User2','New Member'),
    ('User1','All Members'),
    ('User1','Gold Member');
    select * from
    (Select *,ROW_NUMBER() OVer(partition by username Order by case when Usergroup ='All members' then 0 else 1 end desc) RN From @tab ) t
    where t.usergroup= case when t.rn >1 and t.Usergroup='All members' then 'Do not return' else t.Usergroup end
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • How could u write this application?

    write an application to read an unknown number of integer pairs representing binary numbers from a file redirected input from the command line. do not use sentinel value or prompt.
    1. Echo print in colums 1 and 2 the numbers that were read.
    2. Convert each number to decimal for columns 3 and 4.
    3. Count the number of 1's in the numbers for columns 5 and 6.
    4. Find the larger of the decimal versions of the first and second number of each integer pair, and print that number in column 7.
    5. Keep separate cumulative sum of the decimal versions of the first and second number of each integer pair, and print that number below the appropriate column after all numbers have been read.
    Sample output:
    10 11 101 1111 111 10000 101011 0
    thanks for your interest

    > hey young fella, its not a HW or something!! everyone
    talks alot here like they know everthing(which they
    aint gotta clue), i decided to put an easy
    application to c how many people are going to be able
    to write this application??
    That's a little tough to believe. It's far more likely that you need some help on figuring out how to go about writing such an application. There's nothing wrong with that; just know that most folks who volunteer to help here aren't particularly interested in "proving their skills" by way of programming "challenges". They typically get far more satisfaction by helping others learn Java.
    i guess u r one those fellas who dont have a clue about java!!! b/c if u
    were not, this would take ur 5-6 mins of time..
    So, do you have a specific question regarding those requirements? If you do, please ask. If, on the off chance you've got some special insight regarding an implementation, post your idea and get some feedback from the community.
    Also, please make the extra effort to write out words such as "see", "you", "are", "your", and "because". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership. Also, it will give the appearance that you take your question seriously, which will in turn make your question look more interesting to answer.
    Thanks!
    ~

  • How can I write this string to a file as the ASCII representation in Hex format?

    I need to convert a number ( say 16000 ) to Hex string ( say 803E = 16,000) and send it using Visa Serial with the string control in Hex Mode. I have no problem with the conversion (see attached). My full command in the hex display must read AA00 2380 3E...
    I can easily get the string together when in Normal mode to read AA0023803E... but how can I get this to hex mode without converting? (i.e. 4141 3030 3233 3830 3345 3030 3030 3031 )
    Attachments:
    volt to HEX.vi ‏32 KB

    Sorry, The little endian option was probably introduced in 8.0 (?).
    In this special case it's simple, just reverse the string before concatenating with the rest.
    It should be in the string palette, probably under "additional string functions".
    (note that this only works in this special case flattening a single number as we do here. If the stat structure is more complex (array, cluster, etc.) you would need to do a bit more work.
    Actually, you might just use typecast as follows. Same difference.
    I only used the flatten operation because of the little endian option in my version.
    Message Edited by altenbach on 11-16-2007 11:53 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    littleendian71.png ‏4 KB
    littleEndiancast71.png ‏4 KB

  • How could I write this code?

    I am trying to create a shared object that will host a chat
    room environment. I will have many of these rooms and I know what I
    want to do, just not how to write it in actionscript or if it is
    even possible. the underlined portion is what i just don't know how
    to code (
    (room + roomNumber + _so) ) as it should throught usage
    equate to something like
    room1_so,
    room2_so,
    room3_so, and so on. any help would be greatly appreciated.
    thanks in advance.
    function doJoin(roomNumber) {
    (room + roomNumber + _so) = SharedObject.getRemote(
    (room + roomNumber + _so) ,_root.clientroom_nc.uri,true);
    if(
    (room + roomNumber + _so) ).data.seat1 = occupied) {
    do this;
    }

    its actually connecting to flash media server remote shared
    object as opposed to the local shared object. The code in question
    was actually taken nearly word for word from the macromedia sample
    file so I know that that portion is correct.
    If I replace the shared object name from
    tl["room"+roomNumber+"_so"].connect(_root.clientroom_nc);
    and change it to
    room1_so.connect(_root.clientroom_nc);
    everything works fine and the connection is succesful,
    however since I hope to have many many rooms that is just not a
    feasible way to write it. I have racked my brain trying to think of
    an alternative way of writing it but have come up with nothing. I
    am well versed in Basic, PHP, and some C, but this damn
    actionscript stuff is throwing me for a loop since it is incredibly
    different in a lot of ways.

  • How can i write this syntax in script logic....

    hi all
    i need to write below syntax in bpc script logic..
    If Headcount = 0, then Salary = 0 Else:
    If Month <> March and Month <> September:
    Salary = Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)]
    If Month = March:
    Salary = [Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)]  ] * (100% + Band Annual Increase + Band Annual Increase Factor)
    in the above code headcount,salary,bandrate etc all got ids.
    thanks guys

    Hi,
    In your query, when you say that headcount = 0, do you mean the signed data? In this case, it will difficult to do. When you have a signed data as 0 in SQL, once you optimize the application or compress it, that particular record will go and your logic will not work.
    If I look at your logic,
    If Headcount = 0, then Salary = 0 Else:
    If Month March and Month September:
    Salary = Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)
    If Month = March:
    Salary = [Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)] * (100% + Band Annual Increase + Band Annual Increase Factor)
    If the application has been compressed or optimized, it will not get any record for that particular headcount and will directly go into the "else" loop. Though, its not correct.
    I hope you got my point.

  • How do i write this in sql ? (another headcracker challenging  report)

    hi guys!,
    I need to create / generate a report. I intend to do all this with pure SQL alone.
    Been cracking my head for days but to no avail.
    Hope you gurus here will straightened me out.
    Here it goes. i Have a table
    TABLE USAGE_REPORT
    Date DATE -- everyday's date
    BalanceCF NUMBER -- an initial start amount or ( balancebf)
    Topup_amount NUMBER -- amount of topup that day
    Usage1 NUMBER -- amount of $ use on certain prod
    Usage2 NUMBER -- amount of $ use on certain prod
    BalanceBF NUMBER -- BalanceCF + topup - usage1 -usage2 (which is also the next date BalanceCF)
    Example1
    please see this link
    http://img9.imageshack.us/img9/708/88149028.gif
    asumming my sql is
    WITH dates AS
    SELECT TRUNC(SYSDATE) + level dmy
    FROM DUAL CONNECT BY level < 366
    TopUP as
    SELECT trunc(purchase_date) dated, sum(payment_amount)
    FROM purchase
    GROUP by trunc(purchase_date)
    Usage1 as
    SELECT trunc(connect_date) dated, sum(charged_amount)
    FROM tab1
    WHERE prod_id = 'xxx'
    GROUP BY trunc(connect_date)
    Usage2 as
    SELECT trunc(connect_date) dated, sum(charged_amount)
    FROM tab2
    WHERE prod_id = 'yyy'
    GROUP BY trunc(connect_date)
    SELECT * FROM DATES D
    LEFT OUTER JOIN TOPUP T
    ON (D.DMY = T.DATED)
    LEFT OUTER JOIN USAGE1 U1
    ON (D.DMY = U1.DATED)
    LEFT OUTER JOIN USAGE2 U2
    ON (D.DMY = U2.DATED);
    however
    q1) how do i start 'initiate' the 1st row
    BALANCECF so that i can do the calculation
    of
    BALANCECF + TOPUP - USAGE1 - USAGE2 = BALANCEBF
    q2) how do i bring the value of BALANCEBF into the 2nd row of BALANCECF to do further calculation ?
    q3) is it has something to do with connect by ? parent-child relationship
    q4) in short how do i make it look like the attach pic above?
    Please help!
    Best Regards,
    Noob

    I am using 200 as initial balance_cf. You did not provide sample data, so code below is not tested:
    WITH dates as (
                   SELECT  TRUNC(SYSDATE) + level dmy,
                           200 balance_cf
                     FROM  DUAL
                     CONNECT BY level < 366
         topUP as (
                   SELECT  trunc(purchase_date) dated,
                           sum(payment_amount) topup_amount
                     FROM  purchase
                     GROUP by trunc(purchase_date)
        Usage1 as (
                   SELECT  trunc(connect_date) dated,
                           sum(charged_amount) usage_amount
                     FROM  tab1
                     WHERE prod_id = 'xxx'
                     GROUP BY trunc(connect_date)
        Usage2 as (
                   SELECT  trunc(connect_date) dated,
                           sum(charged_amount) usage2_amount
                     FROM  tab2
                     WHERE prod_id = 'yyy'
                     GROUP BY trunc(connect_date)
    SELECT  dmy,
            balance_cf + sum(topup_amount - usage1_amount - usage2_amount) over order by dmy rows between unbounded preceding and 1 preceding) balance_cf
            topup_amount,
            usage1_amount,
            usage2_amount,
            balance_cf + sum(topup_amount - usage1_amount - usage2_amount) over order by dmy) balance_bf
      FROM  DATES D LEFT OUTER JOIN TOPUP T ON (D.DMY = T.DATED)
                    LEFT OUTER JOIN USAGE1 U1 ON (D.DMY = U1.DATED)
                    LEFT OUTER JOIN USAGE2 U2 ON (D.DMY = U2.DATED)
      ORDER BY dmy
    /SY.

  • How can we write this in analytical function..

    select a.employee_id,a.last_name,b.count from employees a, (select manager_id, count(manager_id) as count from employees group by manager_id) b where a.employee_id=b.manager_id;
    As per my requirement I need each manager name and no of employees reporting to him... above query works.. Could anybody help to write the same using analytic function.... Hw this same can be written in effiect way??? (quick performance)
    Please also share the link to download some doc to have good understanding of analytical function..
    Thanks in advance....

    are you trying to do a hierarchical type of query?
    select ename, count(ename) -1 numr_of_emps_under_this_mgr  from  emp
    connect by  empno =prior mgr
    group by ename
    order by count(ename) desc ;
    ENAME     NUMR_OF_EMPS_UNDER_THIS_MGR
    KING     13
    BLAKE     5
    JONES     4
    CLARK     1
    FORD     1
    SCOTT     1
    ADAMS     0
    TURNER     0
    MARTIN     0
    JAMES     0
    SMITH     0
    MILLER     0
    ALLEN     0
    WARD     0Here is the table structure I used (I think you can download it from oracle somewhere)
    CREATE TABLE EMP
      EMPNO     NUMBER(4)                           NOT NULL,
      ENAME     VARCHAR2(10 BYTE),
      JOB       VARCHAR2(9 BYTE),
      MGR       NUMBER(4),
      HIREDATE  DATE,
      SAL       NUMBER(7,2),
      COMM      NUMBER(7,2),
      DEPTNO    NUMBER(2)
    SET DEFINE OFF;
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        800, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1600, 300, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1250, 500, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        2975, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1250, 1400, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        2850, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        2450, 10);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        3000, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, HIREDATE, SAL, DEPTNO)
    Values
       (7839, 'KING', 'PRESIDENT', TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        5000, 10);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1500, 0, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1100, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7900, 'JAMES', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        950, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        3000, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        1300, 10);
    COMMIT;

  • How can I write this small function to create number of Array(s), please?

    Guys,
    How can I have a function create Array depending upon the passed argument. Am I doing this right?
    function createArray(n:int):Array
        for(var i:int=0; i<n; i++)
           var nArr = new Array();
           return nArr[i];
    Thanks a lot.

    var aArraySet:Array = createArraySets(5); //create 5 arrays
    // Array 1 -> aArraySet[0]
    // Array 2 -> aArraySet[1]
    // Array 3 -> aArraySet[2]
    // Array 4 -> aArraySet[3]
    // Array 5 -> aArraySet[4]
    function createArraySets(n:uint):Array
        var aArraySet:Array = new Array();
        for(var i:uint=0; i<n; i++)
           aArraySet.push(new Array());
        return aArraySet;

  • How can I write this short/simple bit of php so it will work?

    Hello!
    I have this code in template.php...
    <?php @ require_once ("$pagename.php"); ?>
    ...to bring content into the template.
    I've got a folder called 'news' for all the news articles so
    how could I edit the code to say 'look for files in the news folder
    as well as the current folder'?
    I guess I would need something like:
    <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    ...but that doesn't work. How would I change it to work?
    Thank you very much and hope to hear from you.
    Mark

    You would need to use the "or" operator in PHP. I'm not too
    sure if that
    will work or not but you can give it a go - I'm currently at
    work now, so I
    can't really test anything at this moment in time.
    This is the operator for "or" in PHP: ||
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    ===============================
    Proud GAWDS Member
    http://www.gawds.org
    Delivering accessible websites to all...
    ===============================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5fhh5$sgv$[email protected]..
    > Hello!
    >
    > I have this code in template.php...
    >
    > <?php @ require_once ("$pagename.php"); ?>
    >
    > ...to bring content into the template.
    >
    > I've got a folder called 'news' for all the news
    articles so how could I
    > edit
    > the code to say 'look for files in the news folder as
    well as the current
    > folder'?
    >
    > I guess I would need something like:
    >
    > <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    >
    > ...but that doesn't work. How would I change it to work?
    >
    > Thank you very much and hope to hear from you.
    >
    > Mark
    >

Maybe you are looking for

  • How can I backup my Ipod touch when it's locked?

    Hello, My IPod touchscreen won't work, but I'm getting a new one with warranty. I can turn the IPod on but I can't "Slide To Unlock" because it wont sense touch. I want to backup all my data/files so I can put it back on the new one. I tried to sync

  • Switch over from taxinj to taxinn

    how to switch over from taxinj 4.7 version to eec6.0, to switch over from taxinj to taxinn, from business data point of view before cutover strategy , what are the things take into consideration , if taxcodes will overlap, with taxinn . what are the

  • MORE THAN 5 USERS CANNOT CONNECT TO MY ITUNES

    ive got itunes set up for everybody at my work, like 12 or more people... problem im having is that if theres already 5 people that have looked at my tunes, nobody else can check out my music... even our IT man here doesnt know anything about it... w

  • HT2534 i phone 4s app store download problem

    when i am downloading free apps from app store it is showing "your account is not valid for use in the emirati store.you must switch to the indian store before purchasing.how can i correct this

  • Putting a Flash Intro on iweb

    I brought a flash intro in .fla format and I was using FTP for mac to upload the flash intro to my iweb. What is the FTP server for site of iweb.