Programmat​ically Cycle through Boolean Array

I'm using an Agilent 34970 with a 34901A switch module. It has 16 switches going to two commons. The end function is to switch through all the sources to read resistance and voltage.
The driver and sample vi from the NI idnet were used as a base for my vi.
The sample vi uses a user-controlled 2-d boolean array (false = open). I want to be able to programmatically cycle through all the switches, but I don't know how to tell the dimensions of array I have.
I would like to go through every element of the 2nd raw for each element in the 1st row. If I could programmatically ignore elements #9, 10, 19, and 20, that would be helpful too.
Thanks for any help!
Attachments:
Agilent 34970 Advanced Scan-2U test-1.vi ‏31 KB
Agilent 34970 Switch-2U test.vi ‏23 KB

CelerityEDS wrote:
Is there a way to determine what's in the vi front panel right now? I cannot determine if it's 2x10 or 10x2... There are no properties of the 2-d array that plainly tell me.
There is "array size" which tells you the actual size of the 2D array.
There are properties that tell you how many rows and columns are visible in the front panel array container.
There are also properties that tell which element is currently scrolled to the top left corner.
The size and index position of the front panel array control or indicator is not related to the actual array size. You can show only 2x2 elements of a 1000x1000 array or vice versa. if the container is too big, the extra elements are greyed. 
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Cycle through an array

    LabVIEW 2013
    Attached is the browser program I am working on. I am trying to cycle through the database elements that are displayed in the cluster by means of a boolean button. Any help would be hugely appreciated
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere
    Solved!
    Go to Solution.
    Attachments:
    Browser.vi ‏156 KB

    This is technically a duplicate thread:http://forums.ni.com/t5/LabVIEW/Sequence-through-a-cluster/m-p/2837814#M829070
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Cycle through list and build compound array...

    I have a database that I'm pulling data from that is already existing. There is a designs table and a details table. The designs table stores the id's of the details items that are associated with the design. Since I'm using Flash remoting I would like to just get all the designs and their details back in one compound array instead of making a bunch of calls. I'm stuck on how to make the string "5,8,12,19" into an array, cycle through the array and then get the details info for each id. Then return the compound array when finished.
    I would prefer the array be like this:
    [design item 1 and it's data][details array of the design 1 items], [design item 2 and it's data][details array of the design 2 items]....
    Here is what I have so far
    <cffunction name="getDesignsByAct" access="remote" returntype="query" hint="gets activities by id">
    <cfargument name="send_id" type="numeric" required="yes" />
        <cfquery name="getDesignsByActQuery" datasource="#dsn#">
        SELECT design_id, design_items
        FROM designs_table
        WHERE design_activity = #send_id#
        </cfquery>
        <cfquery name="getDetailsQuery" datasource="#dsn#">
    SELECT
        FROM
         details_table
        WHERE <!-- cycle through the list of "design_items" in the above query -->
    </cfquery>
        <cfset this_return[1] = getDesignsByActQuery>
    <cfset this_return[2] = getDetailsQuery>
       <cfreturn this_return >
    </cffunction>
    Thanks in advance.

    Is your end goal to get a multi-dimensional array?  a query recordset object?  or an array of structs?  Based on your description, it looks like you want something like this:
    arrMultiDimArray = NewArray(2)
    arrMultiDimArray[1][1] = Query Data from Design Record 1
    ArrMultiDimArray[1][2] = Array of Detail records data structures (or query recordset object?) associated with design record 1
    If that is the case, then you should be able to put something together like this:
    1) Query your design & details data from the database as a joined recordset
    2) Initialize your multi dimensional array
    3) You can use the <cfoutput group=""> attribute to create an outer loop that only changes once for each new design ID
    4) Increment your first dimension array and add your design data to position one of your 2nd dimension
    5) Create a new array to store your Detail record items
    6) Use a nested <cfoutput> loop to loop over your detail item records and populate your new array
    7) Store your new array in position two of your 2nd dimension
    8) Return your 2D array to your flash remoting app

  • Boolean Array Scanning

    I am trying to create a scanning GUI that scans through an array of buttons (Rows) and then when an Arduino switch is pressed, the button in the array (row) that is highlighted is recorded. After the row is selected, the same thing happens to the Columns Array.
    I am having trouble reading the Arduino values at the same time as the buttons highlight.
    CLD Certified 2014
    Solved!
    Go to Solution.
    Attachments:
    StopBooleanProblem.vi ‏257 KB

    A few things:
    As it is, pressing the Stop button will only stop the bottom loop. The top loop could keep spinning since it only stops when it pulls out a value of 1 from the queue, and this value may never get added. E.g., you run the VI, but don't press the button on the Arduino, and then try to press the Stop button. A simple method it to enqueue a 1 to tell the upper loop to stop.
    You do not want to enqueue all the time in the bottom loop. All you're doing is filling up the queue with 0. Since the upper loop has a 1 second timer, you're going to get a whole lot of zeros in the queue since the bottom loop spins so much faster. Thus, enqueue only when you see a 1. Consequently, you will need to wire a timeout value to the dequeue function so that it doesn't sit there forever waiting for a queue value. A small value of, say, 10 msec is more than adequate.
    Instead of placing a numeric constant and then using a conversion function to change its datatype to U8, set the datatype of the constant to begin with.
    There is a much simpler way to cycle through the array index in terms of moving the True. Hint: modulo function, or in LabVIEW speak, Quotient and Remainder.

  • Having images cycle through colors

    Hey guys im currently creating a puyo puyo game and i was wondering for instance say when my puyos touch the bottom boundary and the next two puyo images load how would i have them be different colors? Or if every time i load my J Frame the images are random colors. I want to make the colors that puyos can be limited to red,green,blue, and yellow and cycle through the colors randomly creating different color combination's based on the specified amount of colors. Hope this makes sense here is what i have so far within my animation class i appreciate any help.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*; 
    import javax.swing.event.*;
    import java.util.Random;
    public class PuyoAnimation extends JPanel {
      public static final int numDroppingPuyos=2;
        /**ball color enumerate: Red*/
        public static final int puyoRed=1;
        /**ball color enumerate: Green*/
        public static final int puyoGreen=2;
        /**ball color enumerate: Blue*/
        public static final int puyoBlue=3;
        /**ball color enumerate: Yellow*/
        public static final int puyoYellow=4;
      final int board_height = 6;
      final int board_width = 12;
      final int rightBoundary = 30;
      final int leftBoundary = 130;
      final int image_height= 32;
      final int image_width = 32;
      final int MAX_X = board_height*image_height;
      final int MAX_Y = board_width*image_height;
      private static final int DELTA_Y = 2;
      private static final int TIMER_DELAY = 20;
      Image images[];
      Timer pptimer;
      Random rand;
      boolean keyRight,keyLeft,keyUp;
      int X;
      int X2 = 30;
      int y;
         public PuyoAnimation() {
         super();
         images = new Image[4];
         images[0] = Toolkit.getDefaultToolkit().getImage("puyo_yellow.png");
         images[1] = Toolkit.getDefaultToolkit().getImage("puyo_blue.png");
         images[2] = Toolkit.getDefaultToolkit().getImage("puyo_green.png");
         images[3] = Toolkit.getDefaultToolkit().getImage("puyo_red.png");
         setFocusable(true);
         PuyoMove puyo_move = new PuyoMove(); // Make a new video game KeyListener
         addKeyListener(puyo_move);
         setBackground(Color.BLACK);
          rand = new Random();
          pptimer = new Timer(TIMER_DELAY, new TimerAction());
          pptimer.start();
         public void setAnimation(boolean OnandOff){
            if (OnandOff) {
                pptimer.start(); 
            } else {
                pptimer.stop(); 
         private int color2ImageIndex(int color){
          return color-1;
        public void puyoBoundsRight(){
        if ((X > rightBoundary) || (X2 > rightBoundary)){
        X -= 5;
        X2 -= 5;
        public void puyoBoundsLeft(){
        if ((X < leftBoundary) || (X2 < leftBoundary)){
        X += 5;
        X2 += 5;
       private class PuyoMove implements KeyListener {
         public void keyTyped(KeyEvent k){}
          public void keyPressed(KeyEvent k){
            switch (k.getKeyCode()){
              case KeyEvent.VK_LEFT:
                   keyLeft = true;
                   break;
              case KeyEvent.VK_RIGHT:
                   keyRight = true;
                   break;
         public void  keyReleased(KeyEvent k) {
            switch (k.getKeyCode()){
            case KeyEvent.VK_LEFT:
                 keyLeft = false;
                 break;
            case KeyEvent.VK_RIGHT:
                 keyRight = false;
                 break;
            public void paintComponent(Graphics g){
             super.paintComponent(g); 
            g.drawImage(images[0],X,y,this);
            g.drawImage(images[1],X2,y,this);
            class TimerAction implements ActionListener {
            public void actionPerformed(ActionEvent e) {
             Color c = new Color(rand.nextInt(4) + 1);
               if (keyLeft){
                puyoBoundsRight();
               else if (keyRight) { 
                puyoBoundsLeft();
                y += DELTA_Y;
            if (y + image_width  >= MAX_Y){
           setAnimation(false);
                repaint();
       }

    Hey morgalr sorry to bother you again i tried what you suggested and after compiling i received an error stating that there was an IOException i fixed that but im unsure to on where to go from here it works fine now but i cant get the images to change colors, here is my code so far thanks again
       BufferedImage[] bi = new BufferedImage[4];
                try {
             bi[0] =  ImageIO.read(new File("puyo_yellow.png"));
            bi[1] =  ImageIO.read(new File("puyo_blue.png"));
             bi[2] =  ImageIO.read(new File("puyo_green.png"));
             bi[3] =  ImageIO.read(new File("puyo_red.png"));
             catch ( IOException e )
            // BufferedImage myBI = bi[myRand.nextInt(4)];
           }Edited by: Riz01 on Oct 3, 2009 10:07 AM

  • Iterrate through an array of files

    I am having trouble with the following program, making to iterate through an array of three files, that
    are placed in a directory below the program directory. What I would like my program to do is to read 10 lines of each of the files in the subdirectory and then go back and read another 10 lines from the each files(remembering which file is which) and so on till all the files are read. The number of the files in the subdirectory can change, therefore nothing should be hardcoded!
    Here is the program so far:
    public class thekernel {
    public void thekernel() {}
    public void executeKernel() throws Exception {
    boolean read = false;
    String input_line = null;
    int quantum = 10;
    int programCounter = 0;
    String dirname = "processdir";
    File f1 = new File(dirname);
    if (f1.isDirectory()){
    String s[] = f1.list();
    for(int i = 0; i < s.length; i++) {
    System.out.println (s);
    while ( i < s.length ) {
    RandomAccessFile fr =
    new RandomAccessFile (("processdir/")+s[i], "r");
    while (((input_line=fr.readLine()) != null) &&
    ( programCounter < quantum )){
    System.out.println (input_line);
    programCounter++;
    i++;
    programCounter = 0;
    public static void main(String args[]) throws Exception {
    thekernel K = new thekernel();
    K.executeKernel();
    here is the output it produces at the moment:
    Process_1.txt
    1FORK 1F1
    FORK 2
    WAIT 4
    WAIT 2
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    2FORK 1F2
    FORK 2
    ABCD 3
    WAIT 4
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    3FORK 1F3
    FORK 2
    ABCD 3
    WAIT 1
    FORK 5
    FORK 6
    ABCD 7
    FORK 8
    FORK 9
    ABCD 10
    Any help much appreciated.........................

    You should create an collection of rafs, one for each file, then when you switch between files, the location will be intact.You still need to logic to determine when all of the files have been read. One idea could be to use a vector to hold the rafs, and remove each one as the the eof is reached. When the vector is empty, then all of the files will have been read.
    Something like:
    public void executeKernel() throws Exception {
        final int QUANTUM = 10;
        String dirname = "processdir";
        File f1 = new File(dirname);
        if (f1.isDirectory()){
            String s[] = f1.list();
        class Foo {
            public String name;
            public RandomAccessFile file;
            public Foo(String name, RandomAccessFile file) {
                this.name = name;
                this.file = file;
        Vector files = new Vector()
        for(int x = 0; x < s.length; x++)
            files.add(new Foo(s[x], new RandomAccessFile (("processdir/")+s[x], "r"))));
        String input_line = null;
        int programCounter = 0;
        while(files.size() > 0) {
            for(int i = 0; i < files.size(); i++) {
                System.out.println ( ((Foo)files.elementAt(i)).name );
                programCounter = 0;
                while (programCounter < quantum ) {
                    if( (input_line = ((Foo)files.elementAt(i)).file.readLine()) != null) {
                        System.out.println (input_line);
                        programCounter++;
                    else {
                        files.removeElementAt(i);
                        programCounter = quantum;

  • Periodical​ly cycle through tab controls

    Hi guys so I have a VI where I have 4 different tabs in a tab control where each one of them is monitoring a different machine's temperature. I would like to know if there is any way to automatically have labview cycle through the tabs at maybe 30 second intervals while the VI is running. I have the temperature monitors hooked up to some boolean indicators to let me know when one machine is too hot or too cold, so it would be nice to be able to have labview automatically switch to that tab when any of the boolean indicators go off as well. I'm very new to labview so maybe this is a very simple fix that I just don't know about. Thanks in advance for any help!

    hmmm...i would not connect any software timing to the wait ms function, that would freeze the FP controls from doing anything. use the elapsed time function to free up your while loop
    Attachments:
    tab.vi ‏29 KB

  • Why does pressing the L key twice (to cycle through dimming modes) remove a selected photo from a collection?

    That's my question, Why does pressing the L key twice (to cycle through dimming modes) remove a selected photo from a collection? Is my system the only computer that does this when I follow Adobe's directions to cycle through dimming modes by repeatedly hitting L? If not, how dumb is this?

    Hi,
    Check below things
    ---ManagerRendered attribute is transientAttr and type:Boolean
    ---${oa.viewInsatnce.ManagerRendered} ...paste in Readonly property of the item.
    OARow detailsRow = (OARow)detailsVO.*first()*;
    String position=(String)detailsRow.getAttribute("PositionCode");
    String firstname=(String)detailsRow.getAttribute("FirstName");
    System.out.println(firstname); The firstname is got from detailsRow correctly if I entered it on page.
    if ((position == null) && ("PRESIDENT".equals(position)))
    detailsRow.setAttribute("ManagerRendered", Boolean.FALSE);
    else
    detailsRow.setAttribute("ManagerRendered", Boolean.TRUE);
    Regards
    Meher Irk

  • Walking Through an Array

    Hi, I need some help with dynamic content.
    The end product I need is a series of pictures loaded and
    diplayed in sequence ( one fades in, then out, then another fades
    in & out etc. ) I have an XML connector set up which provides
    the filename to a loader which pulls up the first picture, no
    problem. But I can't work out how to get the following rows from
    the array & cycle through them each time the timeline returns
    to the start.
    any help would be great,
    best wishes
    Robert.

    I setup the demo app on apex.oracle.com:
    http://apex.oracle.com/pls/apex/f?p=26255:3
    Login as demo / demo
    Go to the "products" tab. There is a Test region with a multiselect list. It shows product names (with product id's) from the demo_product_info table.
    When you select multiple things from the list and click apply, it uses the following procedure to simply insert a new record for each into the product table. It increments the product_id by 1000 and prepends "DUPLICATE " to the product_name:
    declare
    cursor c_products is
    select product_name, product_id
    from demo_product_info
    where instr(':' || :P3_X || ':', ':' || product_id || ':') >= 1
    order by 1
    begin
    for r_product in c_products loop
    insert into demo_product_info (product_id, product_name)
    values (r_product.product_id + 1000, 'DUPLICATE ' || r_product.product_name);
    end loop;
    end;
    You can see that is working by using it on the duplicate entries themselves.
    -Richard

  • Stepping through an array

    Dear Forum members,
    Can anyone provide some guidance about how to step through and process data in an array file.  My outline LabVIEW program is to carry out the following steps:
    (1)  Take the first 5 samples from the data file (which contains 1000 samples)
    (2)  Process calculation
    (3)  Take the next 5 samples and process calculation Step (2) until the last batch of samples is reached
    I understand that I will need a loop (200 x 5 samples = 1000 samples analysed), but what I cannot get is how to programmatically step through the array rows, 5 at a time.  If anyone can help it would be appreciated.
    Regards,
    Solved!
    Go to Solution.

    Hi bunnykins,
    Using the Array Subset vi, this becomes a fairly simple problem.
    Just specify a start point and a length of data you want then you can pull a small array of data out of a large one.
    I have attached an example for you to tweak to whatever you need.
    Enjoy!
    -Rob Afton
    Electrical Engineering Intern
    GHSP
    Attachments:
    Subarray Calculations.vi ‏12 KB

  • How to Cycle Through ArrayCollection?

    I have two datagrids and would like to move items from on datagrip and populate the other.  Here is a screen shot for a visual.
    In the screenshot about I can add names/sex to the datagrid on the left by using the text entry and Add button.  I can select the check boxes for each name ros as well. What I want to do is move the check names in the datagrid on the left to the datagrid on the right.  4 max.  But if I only selected 2 name, two names would be added to the Racer 1 and Racer 2. Racer 3 and Race 4 would be left empty.  If I check new names and submitted them it would go into a new row on the left datagrid.
    What I can figure out is how to cycle through the left datagrid and find only the check rows.  Adding them to the right datagrid is easy enough as soon as I figure how to identify what is checked and what is not checked.
    Here is the datagrid on the right.
    <mx:DataGrid x="10" y="76" height="337" id="roster" editable="false" dataProvider="{rosterArray}">
    <mx:columns>
    <mx:DataGridColumn headerText="" width="30">
       <mx:itemRenderer>
          <mx:Component>
             <mx:CheckBox />
          </mx:Component>
       </mx:itemRenderer>
    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Name" dataField="name" width="200" editable="false" />
    <mx:DataGridColumn headerText="Sex" dataField="sex" width="40" editable="false" />
    <mx:DataGridColumn headerText="Time" dataField="time" width="45" editable="false" />
    </mx:columns>
    </mx:DataGrid>
    The function to add to my rosterArray (left datagrid) is below.
    private function rosterAdd():void
         rosterArray.addItem({name:addName.text,sex:sexGroup.selectedValue.toString()});
         addName.text = ""; // empty the text entry field.
    I guess I need to cycle through the datagrid and not the rosterArray since I don't have a place for the check marks in the rosterArray.
    Any help idetifying what rows are checked in the left data grid would be much appreciated.
    Thanks.

    This code is not production-level, but it should answer your question.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.collections.ArrayCollection;
          [Bindable] private var rosterArray:ArrayCollection = new ArrayCollection();
          [Bindable] private var eventArray:ArrayCollection = new ArrayCollection();
          public var num:uint = 0;
          public function processRoster():void{
            eventArray = new ArrayCollection();
            var cnt:uint = 1;
            var race:Object = new Object();
            for each(var obj:Object in rosterArray){
              if(obj.selected){
                switch(cnt++){
                  case 1:
                    race["col1"] = obj.name;
                    break;
                  case 2:
                    race["col2"] = obj.name;
                    break;
                  case 3:
                    race["col3"] = obj.name;
                    break;
                  case 4:
                    race["col4"] = obj.name;
                    continue;
                    break;
            eventArray.addItem(race);         
          private function addParticipant():void{
            rosterArray.addItem({selected: false, name: participant.text, sex: gender.selectedValue, time: null});
            participant.text = "";
            male.selected = true;
          private function removeSelected(evt:MouseEvent):void{
        ]]>
      </mx:Script>
      <mx:RadioButtonGroup id="gender"/>
      <mx:Panel layout="horizontal" backgroundColor="0xFFFFFF"
        borderColor="0x663300" title="Events" color="0xFFFFFF"
        horizontalGap="50">
        <mx:VBox horizontalAlign="right" color="0x000000" paddingBottom="10"
          paddingLeft="10" paddingRight="10" paddingTop="10">
          <mx:Label text="Event Roster" fontWeight="bold" fontSize="14"
            width="100%" textAlign="left"/>
          <mx:HBox width="{roster.width}">
            <mx:TextInput id="participant" width="100%"/>
            <mx:RadioButton id="male" label="M" groupName="gender" selected="true"/>
            <mx:RadioButton id="female" label="F" groupName="gender"/>
            <mx:Button label="Add" click="addParticipant()"/>
          </mx:HBox>
          <mx:DataGrid x="10" y="76" height="337" id="roster" editable="false" dataProvider="{rosterArray}">
            <mx:columns>
              <mx:DataGridColumn headerText="" width="30">
                <mx:itemRenderer>
                  <mx:Component>
                    <mx:Canvas>
                      <mx:CheckBox id="ckbx" selectedField="selected" change="onChange(event);"
                        label="" horizontalCenter="0">
                        <mx:Script>
                          <![CDATA[
                            import mx.controls.Alert;
                            private function onChange(evt:Event):void {
                              if(Boolean(data.selected) == false && outerDocument.num < 4){
                                outerDocument.num++;
                                data.selected = !data.selected;
                                outerDocument.processRoster();
                              }else if(Boolean(data.selected) == true){
                                outerDocument.num--;
                                data.selected = !data.selected;
                                outerDocument.processRoster();
                              }else{                           
                                mx.controls.Alert.show("Maximum of 4 participants can be selected.");
                                ckbx.selected = false;
                          ]]>
                        </mx:Script>
                      </mx:CheckBox>
                    </mx:Canvas>
                  </mx:Component>
                </mx:itemRenderer>
              </mx:DataGridColumn>
              <mx:DataGridColumn headerText="Name" dataField="name" width="200" editable="false" />
              <mx:DataGridColumn headerText="Sex" dataField="sex" width="40" editable="false" />
              <mx:DataGridColumn headerText="Time" dataField="time" width="45" editable="false" />
            </mx:columns>
          </mx:DataGrid>
          <mx:Button label="Remove Selected" fontSize="14" click="removeSelected(event)"/>
        </mx:VBox> 
        <mx:VBox horizontalAlign="right" color="0x000000" paddingBottom="10"
          paddingLeft="10" paddingRight="10" paddingTop="10">
          <mx:Label text="Races" fontWeight="bold" fontSize="14"
            width="100%" textAlign="left"/>
          <mx:DataGrid x="393" y="43" id="eventRace" dataProvider="{eventArray}" width="337" height="365">
            <mx:columns>
              <mx:DataGridColumn headerText="Racer 1" dataField="col1"/>
              <mx:DataGridColumn headerText="Racer 2" dataField="col2"/>
              <mx:DataGridColumn headerText="Racer 3" dataField="col3"/>
              <mx:DataGridColumn headerText="Racer 4" dataField="col4"/>
            </mx:columns>
          </mx:DataGrid>
          <mx:Button label="Remove Selected" fontSize="14" click="removeSelected(event)"/>
        </mx:VBox>
      </mx:Panel>
    </mx:Application>

  • Looping through an array to pass out the variable to Scanner

    I'm trying to get an array of files which end .list in a particular directory and then scan each one for an email address and at the moment print it out. As I understand it Scanner doesn't read from File but will from a String. However each time I try putting it into a String, I get an error as the code tries to pass the full array to it rather than the file names.
    What would be the best way of looping through the array so that each time Scanner gets a new path name applied to it?
    import java.io.*;
    import java.util.Arrays;
    import java.util.Scanner;
    import java.util.regex.*;
    import java.io.File;
    public class FindEmail {
         public static void main(String[] args) throws IOException {
              File userDir = new File("M:\\foo\\bar");
            FileFilter listfilter = new fileFinder();
            File[] foundarray = userDir.listFiles(listfilter);
            for (File i: foundarray) {
              Scanner s = new Scanner(new File(foundarray));
            try {
            Pattern p = Pattern.compile("([\\w+|\\.?]+)\\w+@([\\w+|\\.?]+)\\.(\\w{2,8}\\w?)");
            String str = null;
                 while ( (str = s.findWithinHorizon(p, 0)) != null ){
                     System.out.println(str);
            } finally {
               if (s != null) {
                  s.close();
                }//if
            }//finally
            }//for
         } //main
    }//class
    //class to find the list files
    class fileFinder implements FileFilter {
        public boolean accept(File file) {
            return file.getName().toLowerCase().endsWith(".list");
    }

    The error that I got was
    Exception in thread "main" java.io.FileNotFoundException: [M:\foo\MAIN\BEDEWORK.LIST, M:\foo\MAIN\BEDEWORKSPRIVATE.LIST, M:\foo\MAIN\DONNA-NEW.LIST, M:\foo\MAIN\DONNA-NEWER.LIST, M:\foo\MAIN\DONNA-TEST.LIST] (The filename, directory name, or volume label syntax is incorrect)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.util.Scanner.<init>(Unknown Source)
    at org.stfc.bedework.FindEmail.main(FindEmail.java:17)At the time I had the code:
    FileFilter listfilter = new fileFinder();
               File[] foundarray = userDir.listFiles(listfilter);
               String name = Arrays.toString(foundarray);
               for (int i=0; i<name.length(); i++) {
              Scanner s = new Scanner(new File(name));

  • Cycle through XML on click/swipe

    I'm (still) working on my xml phone book. I need to cycle through the data in the array on mouse click. (The mouse click will be a swipe on a mobile device.)
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
          var theXMLData:XML = new XML(XMLURLLoader.data);
          totalImages=theXMLData.name.length();
          for (var i:Number =0; i < totalImages; i++){
                //push xml data into the arrays
                nameArray.push(theXMLData.name[i]);
                countryArray.push(theXMLData.country[i]);
                portraitArray.push(theXMLData.portrait[i]);
                flagArray.push(theXMLData.flag[i]);
                jobtitleArray.push(theXMLData.jobtitle[i]);
          //data is processed
          loadData();
    function loadData():void {
          var thisPortrait:String = portraitArray[imageNum];
          var thisCountry:String = countryArray[imageNum];
          var thisName:String = nameArray[imageNum];
          var thisJobtitle:String = jobtitleArray[imageNum];
          var thisFlag:String = flagArray[imageNum];
          var dataLoader:Loader = new Loader();
          dataLoader.load(new URLRequest(portraitArray[imageNum]));
          dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
          function dataLoaded(event:Event):void {
                stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
                function loadMainImage1(event:MouseEvent):void {
                      portraitUILoader.source=thisPortrait;
                      flagUILoader.source=thisFlag;
                      selectedName.text=thisName;
                      selectedCountry.text=thisCountry;
                      selectedJobtitle.text=thisJobtitle;
    //add 1 to imageNum
    if (imageNum < totalImages) {
         trace("imageNum " + imageNum);
         trace("image name (thisPortrait) " + thisPortrait);
         imageNum++;
         if (imageNum!=totalImages) {
              loadData();

    solution :
    import flash.events.MouseEvent;
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var contactArray:Array = new Array();
    var imageNum:Number = 0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void
        var theXMLData:XML = new XML(XMLURLLoader.data);
        totalImages = theXMLData.name.length();
        for (var i:Number =0; i < totalImages; i++)
            //push xml data into the arrays
            nameArray.push(theXMLData.name[i]);
            countryArray.push(theXMLData.country[i]);
            portraitArray.push(theXMLData.portrait[i]);
            flagArray.push(theXMLData.flag[i]);
            jobtitleArray.push(theXMLData.jobtitle[i]);
            contactArray.push(theXMLData.contactInfo[i]);
        //data is processed;
        loadData();
    homeScreen_btn.visible=false;
    var thisPortrait:String;
    var thisCountry:String;
    var thisName:String;
    var thisJobtitle:String;
    var thisFlag:String;
    var thisContact:String;
    function loadData():void
         thisPortrait= portraitArray[imageNum];
        thisCountry= countryArray[imageNum];
        thisName = nameArray[imageNum];
        thisJobtitle = jobtitleArray[imageNum];
        thisFlag = flagArray[imageNum];
        thisContact = contactArray[imageNum];
        var dataLoader:Loader = new Loader();
        dataLoader.load(new URLRequest(portraitArray[imageNum]));
        dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
        function dataLoaded(event:Event):void
                portraitUILoader.source = thisPortrait;
                flagUILoader.source = thisFlag;
                selectedName.text = thisName;
                selectedCountry.text = thisCountry;
                selectedJobtitle.text = thisJobtitle;
                selectedContact.text = thisContact;
                //add 1 to imageNum and cycle through the data
                if (imageNum < totalImages)
                    imageNum++;
                    trace(totalImages);
                    if (imageNum!=totalImages)
                        goNext_btn.addEventListener(MouseEvent.CLICK,nextfn);
                    }else goNext_btn.removeEventListener(MouseEvent.CLICK,nextfn);
                }//closes incrementation loop
            }//close loadMainImage
    }//close loadData
            function nextfn(e:MouseEvent):void{
                loadData();

  • I am looping and  through an array comparing two bigdecimals:

    I am looping and through an array comparing two bigdecimals:
    I get the max for valueB only if I have multiple items. not when I have one item why would that be:
    val=0;
    if (array.compareTo(valueB) > 0) {                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi. You were wise to trace the value of n. Your problem seems
    to be that the tests succeed (almost always) in the very first
    iteration because they truly don't match (where n = 0) and
    execution breaks out. You need to adjust the logic. As one
    approach, while sticking with your code and not changing it too
    much (such as using more efficient int vs Number):
    at the very top, define a counter var ct:int = 0;
    before the testing loop, define a flag, such as var
    flag:boolean = false;
    you could then invert the logic in the loop and test for ==
    rather than for !=
    if you find a match, do--> flag = true;
    and break
    at the end of testing, use the flag to decide whether to
    store the new value
    if (!flag) {
    // add to array
    ct++;
    also, use a while loop for controlling the whole thing-->
    while(ct < max) { }
    to know when you're done
    You can also check out the Array functions indexOf() and
    some(), to make things more efficient and faster/easier
    when you're all done, you can also look into using if (a != b
    && c != d)
    for efficiency, instead of nesting them separately
    good luck :)

  • Issues with AUTO cycling through ....

    I'm trying to do this:
    Any help with one or the other is very much appriciated !!!
    1) When the Timer is finish auto cycling through the tabs (1 to 16) of the ViewStack, and switching over to tab (1) to STOP, I would like to address a function to do something ???
    The question is now how to write the code to ID that the Timer has come to a STOP on tab (1), and how can I incoperate this into the existing (onTimerOne) function.
    2) The second item I'm after is that if I'm amnualy select any tab (1 to 16) to address also a function to do something ???
    3) The third item I'm after is to automaticly zero (0) the ViewStack to tab number (1) if I click a Btn.
    <mx:Script>
    <![CDATA[
        import flash.events.TimerEvent;
        import flash.utils.Timer;
        private var timerOne:Timer;
        private function initOne():void {
            timerOne = new Timer(5000, myViewStack.numChildren);
            timerOne.addEventListener(TimerEvent.TIMER, onTimerOne);
        private function onTimerOne(evt:TimerEvent):void {
            if(myViewStack.selectedIndex == myViewStack.numChildren-1) {
            myViewStack.selectedIndex = 0;
            return;
            myViewStack.selectedIndex++;
        private function autoOne():void {
            if (!timerOne.running) {
            timerOne.start();
        private function manualOne():void {
            if (timerOne.running) {
            timerOne.stop();
    ]]>
    </mx:Script>
    4) Well, the fourth item I'm trying to work out is as I'm reading my data from an Xml file to have a TextArea which shows the different countries from the Xml file for each ViewStack tab while auto cycling through these tabs (1 to 16).
    The diffuculty here is that I use this Xml with a specific urlID="1" to urlId="16" as part shown below.
    <urlsOceania>
        <urlOceania urlID="1"/>
        <searchCountry>American Samoa</searchCountry>
        <etc></etc>
    </urlsOceania>
    I'm reading all the other items this way:
    source="{urlsOceania.urlOceania.(@urID==1).etc}"
    Thanks in advance aktell2007

    Thanks for the confirmation.  7 miles away is most likely using the same VZW tower but it does confirm the problem is not in your current location for us.
    You can look up local tower locations from many public websites such as the following:
    www.antennasearch.com
    www.cellreception.com
    http://www.evdoinfo.com/content/view/2990/63/
    The signal of -65 shows you have strong reception but it doesnt show the entire picture.  Your tower could be overloaded or unauthenticating you.  There are lots of little issues that exist outside of the raw signal strength between the towers and the connecting devices that we users have no control over.  As you may guess only a tower tech has access to identify and correct these things.
    Based on the picture of the back of the MBR1515/Netgear N300 router from Netgear I would assume that only a normal sized SIM card will fit.  I would not assume a micro SIM card will fit.  Since I do not have access to either of the VZW or non-VZW 4G LTE router I cannot confirm if it will work or not.  You might have to give Netgear a call and ask.  Based on what I can see from the User Guides of both devices the SIMs used for each should be compatible with eachother.
    If you decide to purchase the non vzw version please post back your findings for us.

Maybe you are looking for

  • Can i revert back to ios5 from ios6?

    I updated my software from ios5.1.1 to ios6 yesterday after being asked by my phone. I hate it and wish i'd never done it! does anyone know is there anyway i can go back to ios5? please help!! thanks.

  • Noob questions...windows emulation on mac OS 10.4

    getting my ibook later this week and was wondering about windows emulation. i don't have an intel processor in my ibook (obviously), so what's your recommendation for a product that runs windows on a mac? and, total noob question, do i have to buy a

  • How to get a list of Intercompany Stock Transport Orders

    Hi MM Gurus, How to get a list of Intercompany Stock Transport Orders with the help of a Transaction,report,  or joining tables. Thanks & Regards, Ashish Anand.

  • 8500A won't print since I replaced ink cartridges.

    Hi.  Ever since I replaced all the ink cartridges (with genuine HP parts)  on my printer it won't print except very faintly in two of the colours, and not at all in the other two.  I've cleaned the printheads, and tried to align the printheads.  Alig

  • Availibility check issue in Production Order

    Hi Every one , One of the user has issue while operating the production order for Material "A". He gets a pop up , "Error during the availibility check for order . Material A is of Material Type HALB. On checking the Log , we have description 1.  "Ma