Is there an example vi for converting an array of boolean to list an array of Int based on a selected T/F state?

I would like to use arrays to minimize code.
I am trying to generate an array of int base on an array of boolean randomly selected.

You can try using 'Boolean to 0,1.vi', found in the Boolean palette: this vi converts a scalar, array or cluster of booleans to a scalar, array or cluster of word (I16 integers).
To use it, simply wire an array of booleans (indicator) to its left, and an array of integers (control) to its right et voilà.
Roberto
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Is there any native method for converting String value to Hungarian notat..

    Hello. there.
    This might be very simple question. but I'm just curious about this.
    I am wondering if Java API offer the any native method for converting uppercased string value to lowercase which obey the Hungarian notation.
    What I'm going to do is using Reflection for excuting RFC function on SAP. I was found it is very similar to JDBC Programming.
    Please refer to blow codes.
    //mTable
    JCoTable mTable = function.getTableParameterList().getTable(rtnTblNm);
        for (int i = 0; i < mTable.getNumRows(); i++) {
         mTable.setRow(i);
         HashMap tmpData = new HashMap ();
              for (int j=0; j < mTable.getNumColumns(); j++) {
                     // I want to set key String [userNo] instead of  [USER_NO] here.
              tmpData.put(mTable.getMetaData().getName(j).toLowerCase(), mTable.getString(j));
              result.add(tmpData);
    } Basically, The idea was from ibatis framework [com.ibatis.common.beans.classInfo] dropcase();
    Any idea would be very helpful for me. Thank you.
    Edited by: hosung.seo on Aug 30, 2009 10:42 PM
    Edited by: hosung.seo on Aug 30, 2009 10:50 PM

    ejp wrote:
    Hungarian notation is a representation of logical/arithmetic expressions in postfix form. Not what you're talking about.
    So your title is very confusing to the people here who know what it means, which is probably all of them, because people read threads based on their title.From now on, I will pay more attention when I post an question.
    If the titile as " +Is there any native method for converting String value to camelcase?"+ would be easier to what i'm pointing at.
    As I mentioned in above sorce code, converting [USER_NO] to [userNo] isn't relevant Hungarian notation. yes, it was ambiguous. Agree! :)
    But some answer wasn't fit to converting case or recognizing "underscore" delimiter. I was expecting toCamelCase() such as blew. Thanks.
        public static String toCamelCase(String name) {
            String lowerName = name.toLowerCase();
            String[] pieces = lowerName.split("_");
            if (pieces.length == 1) {
                return lowerName;
            StringBuffer result = new StringBuffer(pieces[0]);
            for (int i = 1; i < pieces.length; i++) {
                result.append(Character.toUpperCase(pieces.charAt(0)));
    result.append(pieces[i].substring(1));
    return result.toString();

  • Is there any  example snippet for XPath using namespace

    Hi,
    I have used XpathApi class to get the XML node matching my xpath that does not deal with namespaces and it works for me. However, it does not seem to work well when I construct the xpath with namespaces (probably I may be doing something wrong example: //ns:node1/@ns:attr1).
    Can anyone give pointers or some example snippet or some links to handle Xpath with namespaces.
    Also if there is any better approach (Classes or framework) for handing XPath with namespaces then please let me know.
    Thanks,
    -vc

    AnkitG wrote:
    Hi All,
    Is there any example for N9010A EXA signal analyzer , I tried to use example of MXA got from the driver page but couldnt get to work. I need to capture the RF data form the analyzer. Please let me know if there any example or way to do it.
    That is an Agilent instrument. Shouldn't be looking for examples on THEIR website?????

  • Is there any function module for converting text to hyperlink?

    Hello all,
              I am designing an application in BSP wherein the user can enter hypertext values for some
              of the data enteries in the database table. Is there any function module available for converting
              text into hypertext. Eg. if the user enters 'www.mypersonalwp.com' then it should convert this
              text value into a hyperlink.
    Thanks in advance.
    Gurmahima.

    Hi,
    Refer the given below link
    http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
    Hope it helps you
    Thanks
    Arun Kayal

  • How to convert String array into int.

    void getSoldSms(Vector vecSoldSms)
         String str[]=new String[vecSoldSms.size()];
         String words[]=new String[str.length]; // String array
              for(int i=0;i< vecSoldSms.size();i++)
                   str=(String)vecSoldSms.get(i);
              }               //End for
              for(int i=0;i<str.length;i++)
              words = str[i].split("\\|\\|");
              System.out.println();
              for(int j=0;j<1;j++)     
              int count[str.length]=Integer.parseInt(words[i]);
              System.out.print(count[j]*advance_count);
              } // end inner for loop
              }          //End for
         }          //End function getSoldSms
    how do i convert words which is a string array into int type. i kno string can be converted into int using interger.parseint. but wat abt string arrays??? plz help me out with the above code.

    i did tht its still giving the same errorFor Heaven's sake, what about taking a second to try to understand the code you're copying first? If you really can't fix the error yourself, you have a more serious problem than just convertingStrings to ints.
    And if you want { "1", "2", "3" } to be 123:
    StringBuffer b = new StringBuffer();
    for (int i = 0; i < array.length; i++) {
      b.append(array);
    int result = Integer.parseIn(b.toString());

  • Is there any java Charset for converting EBCDIC packed decimal to ASCII?

    Pls reply if you know the solution.

    This is not a function of a Charset, because of the packing. There are plenty of EBCDIC<->ASCII libraries out there.

  • Is there C# example code for the NI 9485 SSR

    Or how can I create my own code? I've looked at the dlls provided and they don't seem to cover this module.

    As far as I know, you just use the digital I/O functions. A 1/true to turn the relay on and a 0/false to turn it off.

  • Is there an easier way to convert bytes into bit(boolean) arrays?

    I am currently using this method to convert bytes into bit arrays:
    /*convert byte to int such that it is between 0-255 this is the bytes[] array
                        if ((bytes/128)==1)
                             bit[c+0]=true;
                        else
                             bit[c+0]=false;
                        if ((bytes[i]-bitInt[c+0]*128)/64==1)
                             bit[c+1]=true;
                        else
                             bit[c+1]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64)/32==1)
                             bit[c+2]=true;
                        else
                             bit[c+2]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32)/16==1)
                             bit[c+3]=true;
                        else
                             bit[c+3]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16)/8==1)
                             bit[c+4]=true;
                        else
                             bit[c+4]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8)/4==1)
                             bit[c+5]=true;
                        else
                             bit[c+5]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4)/2==1)
                             bit[c+6]=true;
                        else
                             bit[c+6]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4-bitInt[c+6]*2)==1)
                             bit[c+7]=true;
                        else
                             bit[c+7]= false;

    You can loop through and use a bitwise operator instead. Here is an example without the loop.
    byte b = 6 ;
    if( b & Math.pow( 2, 0 ) == Math.pow( 2, 0 ) ) ;
    // the 2^0 bit is on
    if( b & Math.pow( 2, 1 ) == Math.pow( 2, 1 ) ) ;
    // the 2^1 bit is onetc...
    You should get something like 110 when you're done.
    If you're wonder what & does (no, its not a boolean &&), it takes the bits in the two numbers you give it and returns a number with all the bits on that are on for each of them.
    For example:
    10011011 &
    11001101 =
    10001001
    So if we take
    110 (6) &
    010 (2^1, or 2) =
    010 (2 again)
    Which means that the number (6) has the 2^1 bit on.

  • Example VIs for winsock with LabVIEW 7.0

    Are there any example VIs for TCP communications with winsock using LabVIEW 7.0?

    I would like to join the request - I would like to know how to use WinSock from within LabVIEW to use a modem to dial a number and connect to another PC with a modem. An extra complicaiton is the fact that I need to be able to vary the number (to access numerous data acquisition stations).
    Message Edited by alysko on 03-08-2006 03:57 PM
    Message Edited by alysko on 03-08-2006 03:58 PM

  • Alogrithm for converting Unicode characters to EBCDIC

    I would like to know if there is any algorithm for converting Unicode Characters to EBCDIC.
    Awaiting your replys
    Thanks in advance,
    Ravi

    I would like to know if there is any algorithm for
    converting Unicode Characters to EBCDIC.Isn't ECBDIC a 7-bit code like ASCII. Unicode is
    16-bit. This means there is no way Unicode can be
    mapped on ECBDIC without loss of information. Link to
    Unicode,
    No. That is like saying that since UTF-8 is 8 bit based then it can't be mapped to UTF-16. But it does.
    EBCDIC either directly supports or has versions which support multibyte character sets. A multibyte character set can encode any fixed format sized character set. The basic idea is the same way UTF-8 works.
    Multibyte character sets have the added benifit that most of the data in the world is from the ASCII character set and the encodings always support that using only 8 bits. Thus the memory savings over UTF-16 (or UTF-32) are significant.

  • BAPI for converting planned order to Production Order(in PP)?

    Hi all,
            Is there any standard BAPI for converting Planned order to Production Order?
    Thanks in advance,
    anjaly

    hi,
    check this..
    BAPI_PRODORD_CREATE_FROM_PLORD BAPI: Convert Planned Order into Production Order
    for more details check this link..
    Create a production order
    <b>reward points if it is helpful..</b>

  • Generate delayed pulse example VI for NI-TIO 6602

    Is there an example VI for generating a delayed pulse for the NI-TIO 6602?
    I found a VI for the NI-STC that has everything I need but it doesn’t work with the 6602 board.
    I would like to set the output pulse delay and  width using the counter’s source (number of pulses).
    Thanks
    Brian

    Thanks Tom
    That pointed me in the right direction.
    Brian

  • Is there any function module to convert date format?

    Is there any function module to convert date format from mm/dd/yyyy to dd.mm.yyyy or sy-datum?

    Hi,
    wirte statement converts any date fomat in system date fromat
        WRITE w_DateTO w_date_sys.
    Regards,
    Sriram

  • There is a Bapi for suppliers like ZWEB_CUSTOMER_GETLIST?

    There is a Bapi for suppliers like ZWEB_CUSTOMER_GETLIST?
    to get list of vendor o suppliers ?

    BBP_VENDOR_GETLIST

  • Convert javascript array to java array

    Is there any way possible to convert javascript array to java array?

    if you will try to experiment a javascript array
    putting it to a hidden element, it will be converted
    to a string (comma delimited). You can get the value
    of that element as a string and use StringTokenizer
    class to put the values into a java arrayThanks, got it.

Maybe you are looking for

  • Posting in accounting

    Dear All, In our business scenerio, credit memo  is raised and after taking approval as release strategy is there  invoicing is done after 3-4 months, at that point of time system is showing error that posting period is closed, which is a standard pr

  • Opening a tab-delimited file in numbers

    Hello, I have a tab-delimited file with the extension .srt to open in Numbers. I can do this easily in Microsoft Excel by going to the Open menu. It then gives me the option to say how the file is delimited and then it opens it. I can't seem to do th

  • Character depiction is collapsed.

    Character depiction is collapsed. (Occurrence yahoo auction in (Japan) Products List) ・this is confirmed in ubuntu 12.04 ubuntu 14.04 . ・Yahoo auction (Japan) Products list display abnormal. ・character depiction is collapsed. (Occurrence yahoo auctio

  • Parts of websites wont load

    Hey there, I seem to have a problem opening some pages, such as www.ryanair.com. The webpage will open, but the code where you can select airports and dates etc wont open (flights, hotel, search). The content on the left of this square as the rest of

  • CM repository Configuartion

    Hi All I needed to configure CM repository(FSDB) . We are on EP 6 SP 11 . I needed the list of steps for the same with versioning enabled. I have tried it from the blog given but the repository doesnt seem to come up in Content Adminstration --> KM C