Repeat / Restart Function on Condition

Hello,
I am attempting to put a statement in my .mxml file to make a private function restart if a certain condition is met.  I am not pro at coding in .mxml, but I believe I have a start at solving this issue.  Below it the code for my function, up to the point that the code would restart, if the condition is true:
The last five lines are devoted to making the function restart itself if the condition 'mapServicesArray.length < 13'.  The line 'init (private function populateLayerDataDictionary);' is supposed to trigger the restart, but I am not sure how to do it (this code clearly doesn't, it is a test of mine).  Any advice would be welcome. 
Thank you in advance! (and sorry for my poor code formatting in this post!)

Here is the code to the function as I have it so far:
   private function populateLayerDataDictionary():void
    //the smallest and largest scales reasonably possible
    var smallestScale:Number = map.lods ? map.lods[0].scale : 1000000000;
    var largestScale:Number = map.lods ? map.lods[map.lods.length - 1].scale : 1;
    var data:Object;
    var priority:int = 0;
    var agsVersion:Number;
    // The next line controls whether the proxy in the <httpproxy> tag in config.xml
    // is used for each layer.  If want this set it to true; otherwise set it to false.
    // If there is no <httpproxy> tag in config.xml then the value of useProxy doesn't matter.
    var useProxy:Boolean = true;
    for each (var layer:Layer in map.layers)
     trace(layer.id);
     if (layer is ArcGISDynamicMapServiceLayer)
      var dmsLayer:ArcGISDynamicMapServiceLayer = layer as ArcGISDynamicMapServiceLayer;
      if (useProxy) dmsLayer.proxyURL = configData.proxyUrl;
      agsVersion = dmsLayer.version;
      if (isNaN(agsVersion))
       // This happens if the map includes a service that is turned off or doesn't exist
       mapServicesProcessed++;
       continue;
      //make an object for this map service to hold the layer information
      var dmsMapServiceObj:Object = {id: dmsLayer.id, layers: new Array(), priority: priority++, url: dmsLayer.url, token: dmsLayer.token, proxyUrl: dmsLayer.proxyURL};
      //add the map service object to the array of map services
      mapServicesArray.push(dmsMapServiceObj);
      // set the max and min scales
      var maxScale:Number = layer.maxScale;
      var minScale:Number = layer.minScale;
      var getScales:Boolean = (maxScale == 0 && minScale == 0);
      if (getScales)
       for each (var layerInfo:LayerInfo in dmsLayer.layerInfos)
        if (layerInfo.maxScale > 0 && (maxScale == 0 || layerInfo.maxScale < maxScale)) maxScale = layerInfo.maxScale;
        if (layerInfo.minScale > 0 && layerInfo.minScale > minScale) minScale = layerInfo.minScale;
       layer.maxScale = maxScale > 0 ? maxScale : largestScale;
       layer.minScale = minScale > 0 ? minScale : smallestScale;
      data = {name: dmsLayer.name, url: dmsLayer.url, token: dmsLayer.token, rtDefExpr: "", proxyUrl: dmsLayer.proxyURL};
      dmsLayer.getAllDetails(new AsyncResponder(onResult, onFault, data));
     else if (layer is ArcGISTiledMapServiceLayer)
      var tmsLayer:ArcGISTiledMapServiceLayer = layer as ArcGISTiledMapServiceLayer;
      if (useProxy) tmsLayer.proxyURL = configData.proxyUrl;
      agsVersion = tmsLayer.version;
      if (isNaN(agsVersion))
       // This happens if the map includes a service that is turned off or doesn't exist
       mapServicesProcessed++;
       continue;
      //make an object for this map service to hold the layer information
      var tmsMapServiceObj:Object = {id: tmsLayer.id, layers: new Array(), priority: priority++, url: tmsLayer.url, token: tmsLayer.token, proxyUrl: tmsLayer.proxyURL};
      //add the map service object to the array of map services
      mapServicesArray.push(tmsMapServiceObj);
      if (layer.maxScale == 0 && layer.minScale == 0 && tmsLayer.tileInfo)
       layer.maxScale = tmsLayer.tileInfo.lods[tmsLayer.tileInfo.lods.length - 1].scale;
       layer.minScale = tmsLayer.tileInfo.lods[0].scale;
      data = {name: tmsLayer.name, url: tmsLayer.url, token: tmsLayer.token, rtDefExpr: "", proxyUrl: tmsLayer.proxyURL};
      tmsLayer.getAllDetails(new AsyncResponder(onResult, onFault, data));
     else if (layer is FeatureLayer)
      var feaLayer:FeatureLayer = layer as FeatureLayer;
      var layerDetails:LayerDetails = feaLayer.layerDetails;
      var tableDetails:TableDetails = feaLayer.tableDetails;
      if (layerDetails)
       agsVersion = layerDetails.version;
      else if (tableDetails)
       agsVersion = tableDetails.version;
      else
       agsVersion = NaN;
      if (isNaN(agsVersion))
       // This happens if the map includes a service that is turned off or doesn't exist
       mapServicesProcessed++;
       continue;
      var url:String = feaLayer.url;
      var pos:int = url.lastIndexOf("/");
      url = url.slice(0, pos);
      //make an object for this map service to hold the layer information
      var feaMapServiceObj:Object = {id: feaLayer.id, layers: new Array(), priority: priority++, url: url, token: feaLayer.token, proxyUrl: feaLayer.proxyURL};
      //add the map service object to the array of map services
      mapServicesArray.push(feaMapServiceObj);
      data = {name: feaLayer.name, url: url, token: feaLayer.token, rtDefExpr: feaLayer.definitionExpression, proxyUrl: feaLayer.proxyURL};
      var allDetails:AllDetails = new AllDetails();
      allDetails.layersDetails = [layerDetails];
      allDetails.tablesDetails = [tableDetails];
      onResult(allDetails, data);
     else
      // skip other kinds of layers (e.g. image services)
      mapServicesProcessed++;
     // restarts and repeats populateLayerDataDictionary if there are missing services
     if (mapServicesArray.length < 13)
      init (private function populateLayerDataDictionary);

Similar Messages

  • How to use complex function as condition in Oracle Rule Decision Table?

    How to use complex function as condition in Oracle Rule Decision Table?
    We want to compare an incoming date range with the date defined in the rules. This date comparison is based on the input date in the fact & the date as defined for each rule. Can this be done in a decision table?

    I see a couple of problems here.
    First, what you posted below is not a syntactically valid query. It seems to be part of a larger query, specifically, this looks to be only the GROUP BY clause of a query.
    Prabu ammaiappan wrote:
    Hi,
    I Have a group function in the Query. Below is the Query i have used it,
    GROUP BY S.FREIGHTCLASS,
    R.CONTAINERKEY,
    S.SKU,
    S.DESCR ||S.DESCRIPTION2,
    S.PVTYPE,
    RD.LOTTABLE06,
    R.WAREHOUSEREFERENCE,
    RD.TOLOC,
    R.ADDWHO,
    R.TYPE,
    S.CWFLAG,
    S.STDNETWGT,
    S.ORDERUOM,
    R.ADDDATE,
    C.DESCRIPTION,
    (CASE WHEN P.POKEY LIKE '%PUR%' THEN 'NULL' ELSE to_char(P.PODATE,'dd/mm/yyyy') END),
    NVL((CASE WHEN R.ADDWHO='BOOMI' THEN RDD.SUPPLIERNAME END),SS.COMPANY),
    RDD.BRAND,
    S.NAPA,
    RD.RECEIPTKEY,
    R.SUSR4,
    P.POKEY,
    RDD.SUSR1,
    r.STATUS, DECODE(RDD.SUSR2,' ',0,'',0,RDD.SUSR2),
    rd.SUSR3Second, the answer to your primary question, "How do I add a predicate with with a MAX() function to my where clause?" is that you don't. As you discovered, if you attempt to do so, you'll find it doesn't work. If you stop and think about how SQL is processed, it should make sense to you why the SQL is not valid.
    If you want to apply a filter condition such as:
    trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')you should do it in a HAVING clause, not a where clause:
    select ....
      from ....
    where ....
    group by ....
    having max(some_date) between this_date and that_date;Hope that helps,
    -Mark

  • How do I repeat a function that starts immediately?

    Hi,
    I am using a Timer function to repeat a function however the function only begins (and repeats) after the period set eg. 5 seconds not immediately.
    Here is an example of the code:
    var myTimer:Timer = new Timer(2000,8);
    myTimer.addEventListener(TimerEvent.TIMER, timerListener);
    function timerListener (e:TimerEvent):void{
    trace("Timer is Triggered");
    myTimer.start();
    Is there any way to make the function start immediately then repeat?
    Thanks
    Chris

    after timer.start()
    add
    myTimer.dispatchEvent(new TimerEvent(TimerEvent.TIMER));
    this will trigger your function immediately

  • Repeat on function in ME21N

    Hi,
    Could some one let me know how does this  Repeat On function work (available in account assignement tab) while creating Purchase order using T code ME21N ?
    Thanks
    ArunVijay D

    Hello,
      One of our users noticed that once the 'Repeat' option is turned on in ME21N on the Account Assignment tab, she cannot get it to turn off even for subsequent  purchase orders she creates.   One of our developers was able to duplicate this issue in our Develpment system as well.   We switch off the 'Repeat' (matchstick) under the Account Assignment tab for a line item, and then if we go to the next line, the 'Repeat' option shows as being on again.   Then if we create a second purchase order, this 'Repeat' option is automatically on also.
    We are on ERP 6.0 for EHP4 and have recently upgraded to Office 2007.
    Does anyone know how to turn this option off again so it doesn't automatically stay on for the user?  There doesn't seem to be any setting under the Personal Settings that would affect this.
    Thanks for any help on this.
    Cheryl
    Edited by: Cheryl Hellestad on Nov 3, 2010 5:32 PM

  • Invalid function body condition: ORA-06502: PL/SQL: numeric or value error:

    I'm trying to customize my link column on an interactive report to branch to another page in my application based on a pl/sql call. My condition type for the link column is pl/sql function body returning a boolean. I'm calling a packaged function that returns a boolean but receive the following error:
    Invalid function body condition: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    This is my code:
    return files_util.list_files('test','test');
    I've tried running the same code in sqlplus and it works fine. Any help would be appreciated.
    Thanks,
    Rob

    It turns out I had multiple issues. I thought the code I was running for the link column would be executed and let me branch to another page to view the results of my pl/sql code. It appears that the pl/sql code for the link column only controls whether the link is displayed or not. The reason for the ora-6502 was because a variable in my pl/sql function was not large enough to hold a value based on the userid signing onto the application. I'm using database authentication so I thought that the userid in apex would be my database userid which is only 4 characters. The userid actually used is apex_public_user which caused by ora-6502 error.

  • IPod repeat one function on the iPad is broken

    I have found that most of the time, the repeat one function when using the iPod function on my ipad just doesn't work. I know where the setting is (on the now playing page), and I select the little circle of two arrows with the 1 on it... and when it gets to the end of the song it goes right on to the next one- usually. Sometimes it works, I don't know why. I don't understand how hey screwed that up; it works just fine on my iPhone and every ipod I own.

    same here with iPad1 on 4.3.3.. quite annoying when you want one special song looping (e.g. as gaming background) - need to wait for the jump to the next song, jump back one manually, and then the loop works.
    I'll be experimenting around a bit to see whether it might depend on the song (file format, bought/ripped...), the issue seems too rare, at least Google turns up only a few hits, compared to other ipod bugs.

  • Upgraded to Mavericks and have lost the closedown/restart function - how can I recover this function. Pressing on/off button just switches off the display. Thanks

    Have just upgraded to Mavericks OS X and have lost the closedown/restart function. Pressing the on/off button just switches off the screen. Thanks

    Hold the power button for about 7 seconds to shutdown or select shutdown under the  menu.

  • Ok so my new iPod Classic is repeatedly restarting itself and I see nothing on the screen But the Apple logo and I canny do anything to stop it can anybody help me

    Ok so my new iPod Classic is repeatedly restarting itself and I see nothing on the screen But the Apple logo and I canny do anything to stop it can anybody help me

    Try the DFU Restore method shown in Corrupt iPod classic.
    tt2

  • When i am using the restart function, lion will surely fail start. How can I fix this problem?

    RT. I am using a brand new mac mini.

    Do you mean the Restart function under the Apple menu?  What happens when you try?
    Launch the Console utility before you try to invoke a restart and look for messages that might explain the problem.

  • Phone Shuts Down Repeatedly & Restarts & Won't Charge Since IOS 8 Upgrade

    Jesus please take the wheel. After reading about all the IOS 8 problems in the past few weeks I thought everyone was nuts until two days ago. My iphone 5 has never been mistreated, dropped, slung across a room, or undergone anything approaching torture. It has NEVER EVER EVER given me ANY problems. All of my apps worked seamlessly, and I never had any issues with the functionality of the phone. And, like the gung-ho Apple product lover that I am, I swiftly upgraded to IOS 8 hoping that things would only get better. BUT in the past two days, without treating my phone any different, it has begun to malfunction. It shut down by itself TWICE in a span of ten minutes two days ago. And each time I turned it back on, it acted as though I asked it to restart. It did the same thing yesterday, EVEN AFTER RESTORING IT TO FACTORY SETTINGS. On top of that, it refused to charge, although it was showing up on my macbook and the little lighting bolt appeared in the upper right hand corner of the phone.
    I am no conspiracy theorist by ANY measure, but I can't help but attribute these problems to the new OS. How do I get help for this? Has anyone else experienced this problem? Have you resolved it? HELP.  Apple certainly won't lose my business and I certainly can't tell other people what to do, but I must echo other people's caution about downlaoding IOS 8. If you have not done so yet, I strongly encourage you to hold off until Apple works out the kinks in this OS.

    Hi sejrphd,
    As someone who depends on my iPhone for communications and computation, I know how difficult it must be to have difficulties such as you describe with your iPhone. Let's see if we can get you back up and running.
    If your iPhone powers off unexpectedly, I would suggest that you troubleshoot using the steps in this article - 
    iPhone: Hardware troubleshooting
    In particular this section -
    Will not turn on, will not turn on unless connected to power, or unexpected power off
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIsand corrosion.
    Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
    After at least 30 minutes, if:
    The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
    The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
    If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
    If the display turns on, go to step 4.
    If the display remains black, go to next step.
    Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
    If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.
    This article may assist you with your battery charging issue -
    iPhone and iPod touch: Charging the battery
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • Process Chain step repeat/restart

    I have a process chain which schedules 3 loads to psa and then loads the data into ods/cubes. it often fails here due to data problems. now there are at least 4 subsequent steps that are not executed due to this failure which is correct but i don't want to have to fix the problem with the data by deleting the requests from the ods/cube and correcting in the PSA and then have to do all the subsequent steps manually.
    Once i have corrected the data in the PSA:
    if i repeat the load to ODS step will it continue through the rest of the chain?
    if i restart the chain will it repeat the extract to PSA steps which i definitely don't want it to do?
    or can i schedule the subsequent part of the chain to run from the planning view?

    Hi Richard,
    I guess when there is some data issue, there is always need for manual intervention.
    "if i repeat the load to ODS step will it continue through the rest of the chain?"
    <i>You have to delete the failed request manually from DataTarget before doing this.</i>
    "if i restart the chain will it repeat the extract to PSA steps which i definitely don't want it to do?"
    <i>Yes. Restarting chain will extract the data again.</i>
    or can i schedule the subsequent part of the chain to run from the planning view?
    <i>I don't think you can start a chain from the middle from planning view.</i>
    Regards,
    Sree

  • [WebIntelligence Reporting] How to use count function with condition !?

    Post Author: xuanthuyit
    CA Forum: WebIntelligence Reporting
    Hi everyone,
    I want to make a report like this  with WebIntelligence reporting.
    I want to show the number of Outlet of each chanel (Horeca, Grocery, Convenience) at the end of report !
    But I don't know how to do that with WebIntelligence Reporting.
    Please help asap. . .
    Thank you verry much,

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    xuanthuyit:
    Apparently =count() &#91;and use of a where&#93; was permissible in previous versions of BusObjects, however, things in XI are different (as other users tell me, being XI is my first experience w/ BusObj...), so anyhow, here is the solution to your question.
    You will have have to create two variables for each condition you have.  One variable will be the "helper" and the other variable will be the "worker".  For instance, create a variable called channel_x and the formula:  =if(channel="haney";<metric>;0)  (where "haney" is the name of your organization and <metric> is the metric you are using to count or sum things in your report).  Once channel_x is saved create another variable called channel_x_count and the formula:  =sum(&#91;channel_x&#93;).  Once channel_x_count is saved, then on your report towards the bottom you can use the Template bar to drag in a new table (perhaps you want to use the Horizontal Table type), and then you can drag channel_x_count into your new table.  You will have to repeat the creations of more channel_x type variables (maybe call it channel_y and channel_y_count) or something more descriptive, but in any case substitute the "haney" constant for the next store you want to track, etc, etc.

  • Using a function as condition for conditional formatting

    Hello,
    I am trying to switch from Excel to Numbers and I'm having trouble figuring out the conditional formatting in Numbers. In Excel, cell(s) can be highlighted, font changed, etc based on a function linked to another cells value. That is, cells A1:A4 can be highlighted if cell A5 has a particular value or not. I can't figure out how to do this in Numbers. Is it possible?
    Thank you in advance for any help.

    rstod7878 wrote:
    Sorry, I haven't had a lot of time lately. Thanks to Peggy for the link to instructions on posting pics. Thanks to Barry for his response (which I haven't explored in detail yet). Here is a pic that may explain what I'm trying to do a little more clearly.
    Here's your image, pulled in with the (edited) HTML code supplied by Flickr
    The editing consisted of removing everything in front of "<img". The essential difference between this code and what you used is the addition of double quotes ( " ) enclosing the whole URL (from "http: to .jpg").
    Both conditions look identical, except for the cell being referenced by the formula.
    Can you restate, in English, the condition under which the cell to which these rules apply would be formatted to have a dotted green fill and text in italics and with a strike through applied?
    Also, to what cell is the conditional formatting applied, and what is the value in that cell?
    Regards,
    Barry

  • Repeat Output Function module

    Hi SDN,
      Is there is any standard function module for repeat output in the shipments(VL02N)?
    Call the transaction VL02N , go to "GOTO" from the menu and choose "OUTPUT". Then select a output type and then press the button "REPEAT OUTPUT".

    Hello Ricky
    To transform ABAP to XML you can use the simple transformation, e.g.:
    DATA:
      gt_itab    TYPE TABLE OF knb1,
      gd_xml   TYPE string.
    * Select data into gt_itab
      CALL TRANSFORMATION id_ident
        SOURCE abap = gt_itab
        RESULT XML gd_xml.
    You could place this coding into a function module having an IMPORTING parameter of type TABLE (generic table type). However, this generic type will not work for a RFC-enable function module.
    Regards
      Uwe

  • How to make wave graph restart when the condition of case structure is changed?

    Exp: Condition of case structure a<b ( a: control, b: constant). A wavegraph puts inside a while loop , in True condition (a<b). How can I make the wave graph restart if a is changed?

    Aren't you confusin waveform graph and waveform chart ? If this is the case, you can clear a chart using the History data property node, fed with an empty array.
    Message Edité par chilly charly le 11-08-2007 01:57 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_BD.png ‏1 KB

Maybe you are looking for

  • Getting rid of the "Availability" category in Calendar

    I have synced my iPhone Calendar with my Google Calendar using Google Sync. However, this adds two additional categories when editing events on the iPhone: availability and invitees. Though I can ignore the invitation options, "availability" always s

  • Please help!!! Cannot run Windows Update in Win 7 Pro after changing new hard-drive. (X201s)

    Hi everyone, I have been using my thinkpad x201s for more than one year by now. And recently I change a new and larger hard drive for my laptop. When I tried the thinkpad rescue and recovery disc on the new hard drive, everything works fine except th

  • I can't resize the reply window in Mac Mail

    My mail is working fine. If I write a new email it all looks okay. If I reply or forward an email the window is so wide it would stretch maybe 3 times the width of my screen, so if I want to use any of the tools in the top right toolbar I have to dra

  • Using and rec on external monitor for photo editing

    ON another forum someone said that the MBP has only a 6 bit output for color on it's laptop screen. Now what about running an external monitor, 6 or 8 bit for the MBP? I have to admit even though I use a monitor calibration for editing my pictures on

  • How to detect signals from serial or parallel ports?

    Hi everybody! I'm developping a p.o.s. app, and I need to detect the printer status (serial or parallel), but I couldn't find the way to do it (I'm using Text_IO). I know about using a C program, but I want to find a simpler way. Is there any command