Sort Array of References by Label-Name

I am developing on an DSC application with shared variables and alarming and events with a hugh amount of variables. Each variable is displayed on the front panel within tab controls. To reduce time and effort when expanding the variables I would like to arrange my references from the front panel by the label name. I've attached a part of the intialization of the front panel. There I have to manually expand each variable in the shared variable library, where the name of the variable has to be in the same order as the definition in the cluster.
My approach was to build an array of references of digital type and sort the references by the label name. Because the shared variables have the same name as the controls they would be in the same order and I also could dislaim the cluster of references.
maybe somebody can give my an hint.
Kind Regards,
Joachim
Solved!
Go to Solution.
Attachments:
fp.jpg ‏982 KB

Hi Joachim,
use the standard "sort an array of cluster" approach!
Put the control label and the reference (in this order!) in a cluster, make an array of such clusters and sort the array. It will sort by the label and you can unbundle the reference in sorted order...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Help setting up back navigation button by label name.

    Newbie back for some gems of wisdom.
    I am trying to get forward and back buttons to advance the user along the timeline by label name. I got the forward button to work, but can't seem to find the right code tweakage to get the back button to work.
    Here is what I have:
    stop();
    var myLabels:Array = [ "A","B","C","D","E","F","G","H" ];
    var nextLabel:String;
    var inc:int = 1;
    var prevLabel:String;
    var inc2:int = -1;
    fwdbtn.addEventListener(MouseEvent.CLICK, clickNextSection);
    function clickNextSection(e:MouseEvent):void
        nextLabel = String(myLabels[inc]);
        gotoAndPlay(nextLabel);
        inc++;
    bkbtn.addEventListener(MouseEvent.CLICK, clickPreviousSection);
    function clickPreviousSection(e:MouseEvent):void
        prevLabel = String(myLabels[inc2]);
        gotoAndPlay(prevLabel);
        inc2++;
    I'm sure there are some reduncies and I know I'm missing the variable that tells the timeline to subtract positioning from the array.
    Do I need to define a new array for the back button?
    Any idea what I'm messing up??
    Thanks!!

    Thanks for the reply! Kind of lost unfortunately.
    So can you tell me how to edit the code to reflect that? Not sure how what the deincriment syntax and is and not sure how to set it up the way you are suggesting - only adding deincriment/increment on the fly.
    Any help you could lend to chopping the code would be appreciated.
    Love the logic you suggest. That would ideal for it to work from any point.
    Thanks for your help!

  • Search through a cluster or clusters in cluster by label-name of a control

    Hi,
    is there a function availabe which allows to search through an arbitray cluster by an label-name and if the desired control is found in the cluster, its value should be returned?
    E.g:
    The function should receive the cluster to be searched and the label-name of the wanted control. The Output should be the value of the control if the label-name was found within the cluster. If the name was not found, there should be a status e.g. -1 at the output uf the function.
    Thanks for your help!
    BR

    I have two general purpose methods in this instance.  The first is to utilize LV's XML schema and a little XPath:
    The second method utilizes Traversal and is contained in the zip file I have attached.  This method is very poorly documented at best (like most scripting).  It was a fun experiment.
    TraverseCluster.vi specifies the callback VI to be used when a control is encountered during the operation called 'FindControls'.  It then calls this traverse operation on the cluster which is based in by reference.  The Callback VI is called for all controls in the cluster, if a Label is specified all matching controls are added to the list.  If no label is specified, all control references contained in the cluster are returned (including those inside subclusters).  You can specify if you only want controls returned and not the clusters. Finally, the Class Operator is removed. 
    There is an example included to see how it all works.
    Traversing is a great tool to have at your disposal if you are a scripter.
    Attachments:
    Traverse Cluster.zip ‏40 KB

  • CompareTo and Sorting Arrays

    I am trying to sort an array of telephone directory information by last, first names, but am having trouble understanding how to use the compareTo method to do so. I thought I could use Arrays.sort, but this doesn't seem to work....any help would be appreciated.
    public static Person [] sort(Person [] people) {
    Person [] sorted = Arrays.sort(people);
    return (Person[])sorted.toArray(new Person[sorted.size()]);
    }/* end sort method */
    //From Person class
    public int compareTo(Object o) {
    Person p = (Person)o;
    int temp;
    if((temp=getLastName().compareTo(p.getLastName())) == 0)
    if((temp=getFirstName().compareTo(p.getFirstName())) == 0)
    //not sure what to do here
    return temp;
    }

    You want to return a negative or positive or zero integer if this item is less than, greater than, or the same as, the object passed as an argument, right? (Read the API.)
    You're trying to sort by last name first, and if they're the same, then the first name, right?
    So you're not really checking for zero, you're checking for non-zero.
    I'm assuming that first name and last name are given by strings, which implements Comparable. So you can do:
    public int compareTo(Object o) {
      Person p = (Person)o;
      int temp = getLastName().compareTo(p.getLastName());
      if (temp != 0)
        return temp;
      // implicit else here
      // MORE CODE GOES HERE
    }I'll let you do the "MORE CODE GOES HERE" as an exercise.
    BTW if you're implementing Comparable, you should probably be overriding equals() as well.

  • What determines whether the Label name and/or Caption appears in the context help window but in other cases, both the label and caption appear in the context help window?

    I am trying to polish an application, and find that I cannot seem to reliably control which of the label or caption text appears in the context help window because I don't understand what rules are in place to determine which should appear. It seems like if I reate a named constant, then use it's right click menu command "Create Indicator" I get a control with only a Label (as long as I don't add a caption). This then appears in the context help window as the label name followed by the description text (after entering some description text). But if I add a caption, the label name is shown in bracket
    s which is a 'feature' I would like to avoid, because I have certain controls where I would like to use a descriptive variable name on the block diagram side without using so much space on the front panel. It seems like there is no way to avoid showing the Label name in the context help for a control/indicator. Is this true?
    I thought the purpose of having a seperate caption was to make the text that appears with a control programmatically controllable, but if that control is not extended to what appears in the context help window, it limits the usefulness of the caption and forces me to re-consider some Label names. However, the problem goes deeper than that because then even when I make the label and caption exactly the same, or if I delete (via a select caption text-backspace or select caption text- delete key .. sequence) the caption for a control, the label name in the context help window still appears in square brackets!
    Can I have complete control over the context help fo
    r a particular control (or has anyone found a third-party context help solution that functions compatibly with LabVIEW 7 in a built application that they will be so kind as to recommend?)
    I have used LabVIEW for three years, and I am now using LabVIEW 7.0.

    Sorry for that.. I was changing the text of my question and didn't read carefully enough in the preview stage. I wanted it to read "What determines whether the Label name and/or Caption appears in the context help window?"

  • How can I sort files in a folder by name?

    How can I sort files in a folder by name? iFS first sort files that starts with upper-case letter and then files with lower-case letter.
    Like:
    A_file
    B_file
    a_file
    b_file
    I want:
    A-file
    a_file
    B_file
    b_file
    This doesn't help:
    String[] sort_attributes = {"NAME"};
    boolean [] sort_orders = {true};
    SortSpecification sort = new SortSpecification(sort_attributes, sort_orders);
    currentFolder.setSortSpecification(sort);
    Do I have to get all items in a folder and then sort them?
    /Elin

    I do not think there is a way to do that without add-ons
    There are a couple of workarounds I am aware of
    * Add the bookmarks manually in the bookmarks library and choose the position. That is using Show all bookmarks -> open required folder -> select a position and right click -> add new bookmark <br />Rather a slow and clumsy process
    * Sort a folder and copy it. If you sort the folder contents then copy and paste them they remain in that order when pasted.
    There are add-ons but I have not tried them. For example
    * https://addons.mozilla.org/firefox/addon/simplesort-bookmarks/
    * https://addons.mozilla.org/firefox/addon/auto-sort-bookmarks/
    There will be others available and take note of the advice to backup bookmarks manaully.
    * [[Restore bookmarks from backup or move them to another computer#w_manual-backup]]_manual-backup

  • How to modify a label name in cfformgroup type="panel"

    I want to change a label name in a panel in cfformgroup.
    Anyone has idea?
    Thanks,

    Ken,
    As your suggestion, I wrote the following codes to change the
    label; however, it did not work. The actionscript changed the text
    in the cfinput but the label in the panel did not change.
    <cfformgroup type="panel" label="New Label"
    bind="{myLabel.text}">
    <cfinput type="text" value="My Label" name="myLabel"
    />
    </cfformgroup>
    Actionscript:
    _root.myLabel.text = "Hello World";
    Finally, I used cfformitem type=”text” and style
    to create the panel as follows:
    <cfformgroup type="vbox" id="editForm"
    style="backgroundColor:##0099ff;" height="22">
    <cfformitem type="text" id="caseListingPanel" bind="Open
    Cases"
    style="color:white; fontWeight:bold;" />
    </cfformgroup>
    Do you have any suggestions?

  • How can I create an ActiveX IDL to pass an array of references into Labview

    It appears that LV is designed to be able to receive a COM variant that contains an array of references but I cannot understand what the appropriate IDL should be on the COM side of things. I am current trying to use a safearray to hold the references but the automation reference in LV returns a variant that is empty (VT_EMPTY). I have had success with COM interfaces that expose single references, scalers and arrays of scalers and I am able to get the data properly in LV.

    Hi,
    It looks like this is a duplicate post.  The other thread is here, and looks to contain a bit more information.  A response should be posted to this thread soon.
    Thanks.
    Jason W.
    Message Edited by jason_w on 10-18-2007 04:46 PM
    National Instruments
    Applications Engineer

  • How to Change the label names in crmd_order

    HI Experts
    in CRMD_order transaction i want to change the lable names to the following Standard labels is it possible?..
    the standard label names are
    Standard Label name proposed label name
    Sold to Party = XXXXXXXX
    Requester = YYYYYYY
    Change Manager = AAAAAA
    Change Advisory Board= BBBBBBB
    I have found one link in sdn,To change the label Names But I am not able to find data element name.
    Kindly provide me  your valuable guidance on the above issue.
    Thanks in advance
    Thanks & Regards
    Anand

    Hi,
    it looks like you want to change the names of the partner functions.
    You can do this in the customizing, for example using SPROScenario Specific SettingsService Desk-Service Desk--Partner Determination Procedure (This one works for both ChaRM & Service Desk).
    The standard procedure in your case would be SDCR0001.
    The recommended way is to define your own Z partner functions and assign them to your own Z Partner Determination Procedure, which you have to replace in the configuration of your transaction type.
    Regards,
    Christoph

  • Lightroom 5 will not sort images properly, either by file name or capture time.  How can I fix this issue?

    I am using Lightroom 5 with OSX 10.9.2 and the sorting feature is not working properly.  When I try to sort my library by file name or capture time, it does not sort properly.  The order of images is mixed and stays that way, even after reboot.  The file information is correct, the sorting is the only issue.  The library is approximately 6,000 images and I am also using a plug in with the Publishing Service feature.  Any help on how to fix this issue without losing my editing work done on the library would be appreciated.  Thanks! Dan

    Thanks! I'm trying to sort by capture time or file name, and neither sorts correctly.  file names 3450, 3451, etc. before files 0234, 0235, etc.  It makes no sense.  Same with capture time.  Times are accurate in meta data, but sorting is just wrong.  I'm using a ShootProof plug in that is only used for uploading files to the web. The issue is in the main library folder, so I'm not sure the plugin has anything to do with it.  Any sort I seem to choose: capture time ascending order, file name descending order, whatever, yields a different yet inaccurate sort.  The below sort is flagged, by file name ascending order.  This is the bottom of the list where it goes from file brigitte_terry_w6408... to brigitte_terry_film_0039... to brigitte_terry_w2825...  Regardless of the 'film' file, the w2825... files should be displayed above w6408.  Thanks for any help!

  • Error : The label 'http' has already been declared. Label names must be unique within a query batch or stored procedure.

    Hi all,
        I have created one SP for sending mail with formatting the HTML code inside script whenever i am individually declaring it and printing its expected but the problem at time of executing SP its giving error like this
    Msg 132, Level 15, State 1, Line 47
    The label 'http' has already been declared. Label names must be unique within a query batch or stored procedure.
    what is the possibilities to overcome this problem follwing is my stored procedure code 
    ALTER PROCEDURE [dbo].[USP_DataLoadMailsend_essRules]
    AS
    BEGIN
    SET NOCOUNT ON;
    SET XACT_ABORT ON;
    BEGIN TRY
    ---BEGIN TRANSACTION T1
    DECLARE @packagelogid INT
    DECLARE @batchlogid INT
    DECLARE @packagestatus CHAR(2)
    select @batchlogid =19870
    --print(@batchlogid)
    DECLARE @script VARCHAR(MAX)
    DECLARE @tableHTML VARCHAR(MAX)
    DECLARE @mailheader VARCHAR(50)
    DECLARE @count INT
    DECLARE @recipients1 VARCHAR(50)
    DECLARE @subject1 VARCHAR(200)
    DECLARE @sql VARCHAR(MAX)
    Declare @UserId varchar(Max)
    Declare @Information varchar(max)
    Declare @TableHTML1 varchar(max)
    Declare @TableHTML2 varchar(max)
    SET @mailheader = ''
    SET @mailheader = (select case
    WHEN FileUpload = 'F'
    THEN 'BussinessRules is Aborted'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) > 0
    THEN 'BussinessRules is Processed with Errors'
    WHEN InRule = 'F'
    THEN 'BussinessRules is Failed'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) = 0
    THEN 'BussinessRules is Succeeded'
    end
    from abc..BatchStatus bts where BatchId=@batchlogid)
    /* Selecting Person Mail as Recipient */
    SELECT TOP 1 @recipients1 = EmailId FROM abc.PersonEmail
    WHERE PersonId = ( SELECT TOP 1 personid FROM abc.FileUploadSummary WHERE BatchId = @batchlogid )AND EmailTypeId = 1
    /* Selecting UserId*/
    select top 1 @UserId=loginid from abc.FUS where BatchId=@batchlogid
    /*Selecting Information about the Status */
    Set @Information=
    (select case
    WHEN FileUpload = 'F'
    THEN 'BussinessRules is Aborted'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) > 0
    THEN 'BussinessRules is Processed with Errors'
    WHEN InRule = 'F'
    THEN 'BussinessRules is Failed'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) = 0
    THEN 'BussinessRules is Succeeded'
    end + N' <br> <B>BatchId= '+ convert(varchar(250),(select @batchlogid)) +'</B>'
    from abc..BatchStatus bts where BatchId=@batchlogid )
    /*Selecting the Error Reason*/
    if exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
    begin
    set @TableHTML1 = '<table border=1><tr><th>Sr.No.</th><th><P>Error Reason :</th></tr>'+
    cast((select td= ROW_NUMBER()over (order by (select 1)),'',
    td=isnull(e.ErrorDescription, '')
    from abc.x.tbPackageErrorLog e --50594
    join abc.x.tbPackageLog p -- 10223
    on p.PackageLogID=e.PackageLogID
    where p.BatchLogID= @batchlogid FOR XML PATH('tr'), TYPE )
    as NVarchar(max)) +'</table>'
    -- print @tableHTML
    if not exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
    set @TableHTML2 = 'Error Reason :N/A'
    end
    -- insert into #tmp values ( @TableHTML1)
    --select * from #tmp
    Set @tableHTML= 'Hello '+@UserId+', <br>Information:'+isnull(@Information,'') +
    '<Table Border=1><Tr><th>Sr No</th><th>Uploaded files </th>:'+
    CAST ((select td= ROW_NUMBER()over(order by f.FileUploadId), '',
    td = f.TableName , ''
    from abc.FileUploadSummary F where BatchId=@batchlogid
    FOR XML PATH('tr'), TYPE ) AS NVARCHAR(max) )
    +'</table>'+
    'Error Reason :'+isnull(isnull(@TableHTML1,'')+ isnull(@TableHTML2,''),'N/A')+ --concat (isnull(@TableHTML1,''),isnull(@TableHTML2,'')
    '<br> Please login to Your Account for further Details..!'
    +'<br>@Note: This is system generated message, Do not reply to this mail. <br>Regards,<br>'+
    'Admin'
    print @tableHTML
    SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
    ,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
    @body = ''' +isnull(@tableHTML,'''')+ ''',
    @body_format = ''HTML'''
    Exec(@sql)
    END TRY
    BEGIN CATCH
    PRINT error_message()
    -- Test whether the transaction is uncommittable.
    -- IF (XACT_STATE()) = - 1
    -- ROLLBACK TRANSACTION --Comment it if SP contains only select statement
    DECLARE @ErrorFromProc VARCHAR(500)
    DECLARE @ErrorMessage VARCHAR(1000)
    DECLARE @SeverityLevel INT
    SELECT @ErrorFromProc = ERROR_PROCEDURE()
    ,@ErrorMessage = ERROR_MESSAGE()
    ,@SeverityLevel = ERROR_SEVERITY()
    --INSERT INTO dbo.ErrorLogForUSP (
    -- ErrorFromProc
    -- ,ErrorMessage
    -- ,SeverityLevel
    -- ,DateTimeStamp
    --VALUES (
    -- @ErrorFromProc
    -- ,@ErrorMessage
    -- ,@SeverityLevel
    -- ,GETDATE()
    END CATCH
    END
    please help me to solve this problem
    Niraj Sevalkar

    This is no string http in your procedure. Then again the error message points to a line 47 outside a stored procedure. I can't tell it is outside, since there is no procedure name.
    But I see that you have this piece of dynamic SQL:
    SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
    ,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
    @body = ''' +isnull(@tableHTML,'''')+ ''',
    @body_format = ''HTML'''
     Exec(@sql)
    Why is this dynamic SQL at all? Why not just make plain call to sp_send_dbmail?
     EXEC msdb.dbo.sp_send_dbmail @profile_name = 'DBA_mail_test'
    ,@recipients = @recipients1, @subject = @mailheader, @body = @tableHTML
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Changing the label name in a label based menu

    Hello,
    In my current dashboard, i have been forced to change the front page label name in a label based menu quite late on in the design. However, this has consequently resulted in the front page not showing up until after I have clicked the mouse. Previously the front page just showed automatically. Has anyone had this problem before?
    Thanks,
    Dilip

    Hello both, i managed to solve this issue by linking the label based menu to entirely new cells. This is not ideal but at least it saved me having to re-do a lot of my work.
    Thanks for your help, dilip

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • Can we get the label name of the particular oracle field using open script

    hi
    can we get the label name of the oracle fields like column name ORDER NUMBER instead of ORDER_ORDER_NUMBER_0 when recording using openscript.

    Good morning
    Do you develop functional or load test scripts?
    I don't think we can in both cases because this is really the name of the field + the index.
    The zero refers to first line normally (then 1 for second line and so on).
    "Order number" is maybe the display label which is not enough to recognize and interact with a field.
    May I ask why you want this, then it could help me (us) to give you a good solution/workaround.
    Cheers
    JB

  • Changing the label name

    Hi all,
    I am trying to change the label name and the text in text view, when i do the changes in development system its changing, but when i transport the changes to testing system the changes does not reflect, i tried resetting the OTR buffer, still it doesn't work for me.
    Help me in this.
    Thanks in advance.

    Hi Thomas,
    Yeah i do have a transport request, and the changes are captured by the request,
    it does not show any error in import log,
    but i solved it, i just deleted the label ui element and then created new, by doing this i got what i want,
    but i really dont know why its not changing when i change just the name.
    anyhow thankx for the mail.

Maybe you are looking for