Index of ForEach

I have a problem by specifying the current index at the stage of ForEach.

I have a local array of containers called FreqContainer where each container contains three numbers: LoFreq, MidFreq and HiFreq.

On the loop ForEach is tab table to iterate on: Locals.FreqContainer, the current item and the current offset are empty. The current index is a string, Locals.Iteration.

At a stage in the foreach loop, I'm trying to access one of the elements using the:

Locals.CurrentFreqMHz = Locals.FreqContainer [Locals.Iteration]. MidFreq

Index is a problem, it seems to be '[' [0]'] '.

Could not find a lot of useful documentation or examples of ForEach.

Thank you, jvh

Assuming that you have a table of base zero unique dimension, you must use current offset, no current index.

The index is a string so that it can return a multidimensional index in a single value. To use it in an expression, you must call Evaluate such as:

Evaluate ("Locals.MyArray" + Locals.Subscript) = 10

Tags: NI Software

Similar Questions

  • ForEach: How to set the default value of a command link text while

    Hi all

    I use Jdev 11.1.1.7

    I have a page with 2 foreach

    <af:toolbar id="t1" inlineStyle="border:1px solid #bfc6c9;border-radius:2px;border-right:0px;">
                <af:forEach items="#{pageFlowScope.pbPagePovDetails}" var="page" varStatus="index">
                  <af:panelGroupLayout id="pgl5" layout="vertical">
                    <trh:tableLayout id="tl1" cellPadding="0" cellSpacing="0" halign="center">
                      <trh:rowLayout id="rl1">
                        <trh:cellFormat id="cf2" inlineStyle="border-right:1px solid #bfc6c9;padding:3px;height:38px;">
                          <af:panelGroupLayout id="pov_pgl3" layout="vertical" inlineStyle="padding:5px; border-color:ActiveCaption;min-width:125px;">
                            <af:panelGroupLayout id="dc_pgl6" layout="horizontal"
                                                 rendered='#{pageFlowScope.settingsDimLabel eq null or pageFlowScope.settingsDimLabel eq "Show Dimension Name"}'
                                                 inlineStyle="font-weight:bold;">
                              <af:commandLink text="#{page.dimName}" id="dc_cl1" actionListener="#{pageFlowScope.HspPovBarBean.openMSFromDimension}" rendered="#{page.axisType==3}"/>
                              <af:outputText value="#{page.dimName}" id="ot1" rendered="#{page.axisType==2}"/>
                            </af:panelGroupLayout>
                            <af:panelGroupLayout id="dc_pgl9" layout="horizontal" rendered='#{pageFlowScope.settingsDimLabel eq "Hide Dimension Name"}' inlineStyle="height:10.0px;">
                              <af:spacer width="10" height="11" id="dc_s5" inlineStyle="font-size:small;"/>
                            </af:panelGroupLayout>
                            <af:panelGroupLayout id="dc_pgl7" layout="horizontal">
                              <af:forEach items="#{page.memDetail}" var="mem">
                                <af:outputText value="#{mem.memName}" id="ot2" rendered="#{page.axisType==2}" inlineStyle="font-size:smaller;"/>
                                <af:commandLink id="dc_cl2" text="#{mem.memName}" actionListener="#{pageFlowScope.HspPovBarBean.openMS}" inlineStyle="font-size:smaller;"
                                                rendered="#{page.axisType==3}"/>
                              </af:forEach>
    
    
                              
                            </af:panelGroupLayout>
                          </af:panelGroupLayout>
                        </trh:cellFormat>
                      </trh:rowLayout>
                    </trh:tableLayout>
                  </af:panelGroupLayout>
                </af:forEach>
              </af:toolbar>
    

    His work as expected, but then the text is displayed in #{mem.memName} I want to manipulate this value.

    To do this, I created a variable at the bean

    public class HspPovBarBean{
    
    String memDisplay=null;
    
    
    public String getMemDisplay(){
    memDisplay = (String)resolveExpression("#{mem.memName}");
    memDisplay += ",";
    return memDisplay;
    
    }
    

    But I'm unable to get the value of memDisplay as its null.

    Please let me know if this isn't the correct way to this defect.

    Thank you

    ASHA as


    ASAS

    You can do it directly in the af: outputText

    or in the link or everywhere where you need to display the additional «»

    Timo

  • AF:foreach nested in panelGridLayout

    12.1.3 Jdev

    Hello.

    I'm building a panelGridLayout with 2 labels of af: forEach as in the following code.  The first af:forEach is for a loop of 10 (will be replaced by the EL expression to get the number of the bean) number of rows.  The second af:forEach is to loop through and create 6 cells in each row.  For the first line being forEach would begin = '0' end '5' =, = "6" end = "11" be forEach would begin by the second row, third row would be forEach start = "12" end = "17", etc..  Thus, the formula would begin = "0 + (row * 6)" end = "5 + (row * 6)".  How can I define a formula like this in the begin and end in forEach?

    < af:panelGridLayout id = "pgl8" >

    < af:forEach var = "row".

    start = end of the '0' = '9' step '1' = >

    < af:gridRow marginTop = '5px' height = 'auto' marginBottom = "5px" id = "gr9" >

    < af:forEach elements = "#{bindings." Var ItasObjectCategoriesVO3.rangeSet}"="item.

    Start = '0' end stage '5' = '1' = >

    < af:gridCell marginStart = "5px" width = "17%" id = "CG25" >

    < af:link text = ' #{point.» DisplayName}"id ="l1"/ >

    < / af:gridCell >

    < / af:forEach >

    < / af:gridRow >

    < / af:forEach >

    < / af:panelGridLayout >

    Thank you

    -Mina

    Timo thanks for the tip. I found that the proper syntax is:

    #{(vs.index*6)} and #{(vs.index*6) + 5}

    -Mina

  • script to add vmk1 for vmotion using foreach

    OK, so I am writing a script to add ecards to a host or multiple hosts.  The idea of the user will input one or several host names separated by a comma.  This part works fine, but the next variable I need filled is the ip address, which is also the registration of the user separated by a comma.  I can't find a way to get both of these channels in a single command.

    $servers = (Read-Host "enter host names that you want to configure... FULL domain name (separate them with comma) ").split(',') |" % {$_.trim ()}

    $lasttwooctets = (Read-host "which is the last two octets of your IP prod? (separate with comma) ").split(',') |" % {$_.trim ()}

    #Add VMK1, vmotion, nas, and backup

    foreach ($esxihost in $servers) {}

    New-VMHostNetworkAdapter - VMHost $esxihost - PortGroup 'dvPortGroup_999 (vmotion)' - 'dvSwitch_vcenter' VirtualSwitch - IP 172.24. $lasttwooctets - subnet mask 255.255.0.0 - VMotionEnabled: $true - mtu 9000

    }

    If anyone has an idea on how to make an extra foreach for the $lasttwooctets variable that would be greate

    Since you have 2 bays where the elements come together, it will be easier to do indexing yourself, instead of using the 2 nested ForEach loops.

    Something like this for example

    $servers = (Read-Host "enter host names that you want to configure... FULL domain name (separate them with comma) ").split(',') |" % {$_.trim ()}

    $lasttwooctets = (Read-host "which is the last two octets of your IP prod? (separate with comma) ").split(',') |" % {$_.trim ()}

    #Add VMK1, vmotion, nas, and backup

    0. ($servers. Count - 1) | %{

    "New-VMHostNetworkAdapter - VMHost $servers [$_] PortGroup-"dvPortGroup_999 (vmotion)"- VirtualSwitch 'dvSwitch_vcenter'"

    -"172.24.$($lasttwooctets[$_])" - subnet mask 255.255.0.0 - VMotionEnabled IP: $true - mtu 9000

    }

    You could test whether the $servers table and the $lasttwooctets table have the same number of elements, to ensure that user input is correct.

  • BPEL 2.0: assessment of the values of node in the forEach loop

    [With the help of BPEL 2.0, SOA Suite 11 (11.1.1.6.0) Linux Virtual Box on Windows 7]

    It seems like it should be pretty simple, but for some reason that is eluding me. I run a database query to return a list of nodes in the network in a system. then I execute a forEach income statement using a number of XML nodes as a limit of loop. It all works very well.

    That is the problem. now, I'm just (?) try to assign the value of the current node UID in the loop to a local variable, using concat and the loop index. Thus, the value should be something like "401" or "523". However, what I actually get back is concatenated XPath itself, as well as the iteration of the loop, my variable is as follows:

    [< currentNetworkNodeID xsi: type = "def:string" > $networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[1] < / currentNetworkNodeID >
    ...
    [< currentNetworkNodeID xsi: type = "def:string" > $networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[2] < / currentNetworkNodeID >
    etc...

    I tried to reach "/ text()" to the end, using ora:getNodeValue (...), etc., but nothing I tried to will give me my value of the current node. If I just use "$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid", I get an error of multiple selection, as expected, because there is always more than one executionNetworkNodeUid.

    How I can truly assess these XPath expressions to assign the node real value to my variable...? I can do this in a simple entitled, as I'm doing, or what I have to use a transformation...?

    Here is the code:

    < parallel forEach = "" counterName = "nodeCounter."
    name = "forEachNetworkNode" >
    < startCounterValue > 1 < / startCounterValue >
    < finalCounterValue > count($networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode) < / finalCounterValue >
    < name of scope = "Scope1" >
    < variables >
    < variable name = "currentNetworkNodeID" type = "xsd: String" / >
    < / variables >
    < name of sequence = sequence of '1' >
    < assign the name = "assignCurrentNodeID" >
    < copy >
    ([< to > concat('$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[',$nodeCounter,'] ') < / from >
    < to > $currentNetworkNodeID < /pour >
    < / copy >
    < / assign >
    < / sequence >
    < / scope >
    < / forEach >

    Edited by: rhoward on April 3, 2013 15:08

    Should not just $networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[$nodeCounter] without using concat?

    Hruthayah

  • Create an array of Virtual Machines with an index to allow the selection of the index entry

    I would like to help with the following.

    Using the GET - vm to return all the virtual machines in a table or a table, but with a number of index against each of them. Perhaps even the number of its position in the matrix or $myarray [0]. I am struggling with the best way to go, be it a table to 2 dimensions or an object, but then how do I get the numbers in there.

    The reason for this is to present a list of virtual machines with a number on the side, to which the user then enters the number instead of having to type the name of the virtual machine.

    Ideally resembling:

    vCenter 0

    1 Exchange

    2 FilePrint

    3 SQL

    4 DC

    $vms = $get - vm | Select name

      1. a way to get the number. ##

    $vmsindexed =?

    '' This is the virtual machines to the choice.

    " "

    $vmindexed

    " "

    $selectedNum = read-host "enter the number of the Virtual Machine to power on.

    $selectedVM = $vms [$selectedNum]

    "You have selected Machine virtual $selectedVM.

    " "

    Start-VM - VM $selectedVM

    Thank you in advance, I'm going crazy thinking about it!

    The following script will give you a list of virtual machines with a number on the front, then you can type the number, choose the virtual machine you want to start:

    $VMs = Get-VM
    $VMsArray = @()
    $VMs | ForEach-Object { $VMsArray += $_.Name }
    Write-Output "Here are the virtual machines to choose from"
    Write-Output ""
    For ($i = 0; $i -lt $VMsArray.Length; $i++ ) { Write-Output "$i $($VMsArray[$i])"}
    Write-Output ""
    $SelectedNum = Read-Host "Enter the number of the Virtual Machine to Power On"
    $SelectedVM = $VMsArray[$SelectedNum]
    Write-Output "You have selected Virtual Machine $SelectedVM"
    Write-Output ""
    Start-VM -VM $selectedVM -Confirm
    

    Robert

  • Adaptive tags: loop in pcs:foreach counter

    People,

    Has anyone been able to add a loop counter a < pcs:foreach var = expr = "foo" "bar" > Adaptive tag?

    Would simply increment an integer in the loop and then make a logic in the loop based on this variable.

    I would also like to know the length of a variable prior to iterate, if this is possible.

    And finally, is it possible in a pcs:foreach to indicate if you are on the LAST member of the collection?

    Thank you!
    Robert

    I have not tried, but it should work:



    This is element
    on

    To get the length of a variable, you use something like this:

    To tell if you are at the end of an array, something like this might work:


    Here's a useful documentation on Publisher 6.5 (even if it says docs60, it is the same for 6.5 AFAIK):
    http://download.Oracle.com/docs/CD/E13174_01/AluI/devdoc/docs60/index.HTML#references/ContentServer/index.htm

    Plumtree says:
    People,

    Someone did add a loop counter to an adaptive tag?

    Would simply increment an integer in the loop and then make a logic in the loop based on this variable.

    I would also like to know the length of a variable prior to iterate, if this is possible.

    And finally, is it possible in a pcs:foreach to indicate if you are on the LAST member of the collection?

    Thank you!
    Robert

  • The Vector.forEach () help

    Hello,http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html?Vector.html &

    I have problems with the forEach on the class Vector method (http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html?Vector.html &)

    He tries to explain it, but it's too complicated for my brain.

    In my .fla file, I have a vector filled with objects:

    var balls: vector. < DisplayObject > = new Vector. < DisplayObject > ();

    Vector objects are all of the same class, which has a draw() function.

    Now, I want to browse all items in the vector and call the function draw() on them. I thought I could do something like:

    balls.forEach (draw ());

    But is not float (I miss Ruby). I think I need to use the second parameter of the forEach method, but for the life of me I can't get there.

    I am forced to use a vector (as opposed to a table), because the other calls to the API require it.

    Thanks in advance,

    Tobias

    Try something like this - might work:

    var callDraw:Function = {function(item:T,_index:int,_vector:Vector._):void}
    //

    (as Object) .draw () / / could work

    (as DisplayObject) .draw () / / error - has no method to draw

    (as MovieClip) .draw () / / will work if MovieClip and has the draw method

    (as MyCustomClassOrInterfaceThatHasADrawMethod) .draw () / / work

    };
    balls.forEach (callDraw, null);

    NOTE: the signature of the function must have appropriate type declarations. i.e.

    function (element: MyCustomClassOrInterfaceThatHasADrawMethod, index: int, vector: Vector.)

    Post edited by: Raymond Basque

  • JDev10g - compontent Foreach in ListBox component

    I have 2 list boxes, where the first is dependent on the other, based on one ID. However, the IDS are not in order, and the list is striking an index (and no ID)

    I'm trying to use a foreach inside the list box item to enter the ID, but I'm not sure how to use it... I have:

    "{< af:selectOneChoice value="#{bindings[\'LOOKUP_VO1LookupId\'].inputValue} ".
    label="#{bindings[\'LOOKUP_VO1LookupId\'].label}.
    ID = "sΘlectionner".
    autoSubmit = "true" >

    < af:forEach elements = "#{bindings." LOOKUP_VO1Iterator.allRowsInRange}.
    var = "LookupId" >
    < af:selectItem value = "#{LookupId.LOOKUP_ID} '"
    label = "#{LookupId.LOOKUP_ID}" id = "si1" / > "
    < / af:forEach >
    < / af:selectOneChoice >


    and I get the error message:
    Error getting property 'LOOKUP_ID' of bean of type oracle.jbo.server.ViewRowImpl

    Hello

    I confused with the _ in the name of vo, LookupId attribute to display in the list, your code should be something like below:

    
         
              
         
    
    

    I hope it is clear now.

    You can go in the post on the forum I gave in the previous answer for more understanding.

    Note: before running the jspx page, make sure that the LOOKUP_VO1RowImpl class is generated

    Jean Lou

  • I followed these steps several times, but he still has to work to rebuild the index.  Is there something else in the way of this work?

    Have you tried to rebuild the index spotlight several times, but it didn't work. I followed the steps through the system preferences, but there is no result for the rebuilding of the index.  Is there another way to do it, or is there another problem preventing it from working?

    Do you mean the following steps:

    Rebuild the index on your Mac - Apple Support Spotlight

  • Index of the markers of the Viewer?

    In the index of the timeline, you can see the list of markers in the timeline. Is it similar to put in markers Viewer?

    mnstudio wrote:

    In the index of the timeline, you can see the list of markers in the timeline. Is it similar to put in markers Viewer?

    Well, sort of... you can set your browser to display the list and twirl the little open triangles.

    You will see all kinds of things, such as Favorites, keywords, etc..

    There is no way I know of to make sure that you only see the markers.

  • How to tell if Spotlight indexes

    Hello

    I want to Spotlight index, or rather, re - index volume. I added then it subtracts Soptlight > privacy, but was curious:

    How will I know if Spotlight indexes?

    Open the activity monitor and see how active the process of mdworker is.

  • problem opening document pages. Get the message: the requested index.xml file is missing.

    I can't open the document 'Pages' and get "the index.xml file required is missing."

    You should post the related issues of Pages in the Pages for Mac community support.

    You try to open a document v5 Pages in Pages ' 08 or 09 ' which does not support the format of document Pages v5. Exit your application Pages ' 08 or 09 ' and then double-click the document even have it open in Pages v5.

    When you are in Pages ' 08, ' 09, or same v5, the red light on the title bar of the document just close the current document and fails to complete Pages.

  • Remove corrupt index '$I30' file 0 x 5 (.). ???

    Hello I can't a lire participation from my hard drive with this message delete corrupt index '$I30' file 0 x 5 (.). ???

    Is it using first aid/repair utility disk or chkdsk for the Bootcamp NTFS partition?

  • invalid file - index.xml file missing

    Having a copy of a document of s numberand tried to print but got the notice above - index.xml file missing. I'm unable to edit or print the document and can not find the original document

    Can't seem to find much information on this

    Hi KOB,.

    This is the alert that comes u when you try to open a file of 3 numbers with 2 digits. You still have bothe on your machine. Exit numbers 2 and yor open file of a few numbers 3 and you should be good to go.

    Quinn

Maybe you are looking for

  • App is no longer supported

    I have an application that I used for a while on my ipad. I want to add to my iphone, but the company is no longer active and cannot support the application, it is no longer available in iTunes. Because I have the app on my ipad, and it is saved on t

  • Satellite C660-1F1 - Minecraft ha_err_pid error

    Toshiba Satellite C660 1F1 my son with Windows 7 Home Preium will not run Minecraft and creates a dump of notification and error with Java runtime environment. Yesterday, I wiped the laptop with the recovery disk and installed all the latest drivers

  • W540 errorlog

    Come to discover each day, I was on my W540, a test error log was created. The file names are: SDKLOG_YY_MM_DD, where YY = 14, MM = 02, 03 and DD are the days of February and March I had the W540. These files are in the Lenovo\LenovoConnect folder. H

  • How to make a private folder

    I want to make a folder on my c, private drive so that I can access it - how can I do this?

  • NTLDR not found, do not start the cd

    Recently, I reformatted my hard drive to solve a problem with my computer randomly, making a rude noise beep and turn off. with my freshly formatted hard drive, I put in my windows installation disc and got pretty much at the end of the installation