100 Random, 2-digit, array elements.... help!!!!

Hello. I need to populate an array with 100 random 2-digit elements, then, in a regular output window, print those elements on 10 separate lines, 10 elements per line.... After about 3-4 hours of failures with 'for', 'while', and 'if' statements, I admitted to myself that I am stumped. If anyone could help me out on this within the next 14-16 hours, I would greatly appreciate it.

here's what i've gotten so far:
import java.util.Random;
public class ArrayPopulation
final static int LIMIT = 10;
public static void main (String args [])
     Random generator = new Random ();
     int index = 0, index2 = 0;
     while (index < LIMIT)
          int random = generator.nextInt(99);
          if(random >= 10)
                  int[] TestScores = new int[random];
System.out.print (TestScores[index] + "
index] + "  ");
                   if (index > LIMIT && index2 < LIMIT)
System.out.println();
index2++;
          index++;
}my out put is always 0's for this, and i lost track
of the method that gave me numbers. unfortunately, it
is not printing 10 elements per line, not to mention
10 lines with 10 elements each line (totalling 100
elements). i'm going crazy because it is probobly
something small, but i really don't know at this
point.Well, one of the first problems you are having is that you are creating a new int array every time you execute the following line:
int[] TestScores = new int[random]The size of the new array is random and it is probably initializing to have all zeros in the array, which is why you print zeros.
You probably want to assign the value into an array, and keep the array around until it is populated. Then print it.

Similar Messages

  • Subtract single digit array elements

    hi all
    i have created 2 int array both have the same size of 15... i don't have to fill it all in ...
    so it can be half of the array filt in with number and the rest will be zero's by default...
    so each element can have only one digit
    example:
    int[] arr1 = {1,2,3,4,6,8,5}
    int[] arr2 ={1,0,0,2,3,2}
    int[] subtract = new int[15];
    now i want to subtract arr2 from arr1 and add the resault in subtract array
    this array can also hold one digit only in each of its elements.
    the size of this new array can be 15 and more...
    what i did is i pushed all elements value of arr1 and arr2 to the end of the arrays, and i start add the result also at the end of subtract array
    so the will look like this :
    arr1 = {0,0,0,0,0,0,0,0,1,2,3,4,6,8,5}
    arr2 = {0,0,0,0,0,0,0,0,0,1,0,0,2,3,2}
    it works fine but i have 2 problems
    1- it works fine only if the result will be (+value) value greater than or equal 0sorry i don't know the english name of this .. that mean it works when arr1 - arr2 >=0
    i couldn't find a way to give the result if result value less than zero ,,
    2-as you see i push all number to the end of the array how can i
    remove the zero's from the left side of first number when i print them ??
    here is the method i used to subtract
    public static int[] subtractIntArrays(int[]array1 , int[] array2)
              int total=0;
              int remainder =0;
              int []arraySubtract = new int[6];
              for(int i=(array1.length-1); i>=0; i--)
                   if ((array1[i]- remainder) - array2<0 )
                        total =(10+array1[i]- remainder) - array2[i];
                        arraySubtract[i]=total;
                        remainder=1;
                   else
                        total =(array1[i]- remainder) - array2[i];
                        arraySubtract[i]=total;
                        remainder = 0;
              return arraySubtract;

    >
    it works fine but i have 2 problems
    1- it works fine only if the result will be (+value)
    value greater than or equal 0sorry i don't know the
    english name of this .. that mean it works when arr1
    - arr2 >=0Your english looks fine to me.
    What value do you expect for 2 - 8 ?
    You might want to look at java.lang.Math.abs(int)
    i couldn't find a way to give the result if result
    value less than zero ,,
    2-as you see i push all number to the end of the
    array how can i
    remove the zero's from the left side of first number
    when i print them ??Check if the value is zero using an if statement and only print if it is not-zero.
    If you really want just to the left (zeros in the middle are ok) then use a boolean to signal that you found the first non-zero value and use that it your if statement as well.

  • Unlimited number of array elements, help please!

    Hi everyone,
    I have written this code for comparing two arrays but i don't know how to accept all types array lengths. Now i am limited to 5 elements and i want it to accept the the users desired number of elements. How should i do?
    import java.util.*;
    class console
    public static void main (String[] args)
    ConsoleInput ci = new ConsoleInput();
              System.out.print("Hur m�nga Vektorer ska lagras? ");
              int antal = ci.readInt();
              if (antal<2)
             System.out.println("Du beh�ver 2 st vektorer");
             System.out.println("Hur m�nga element per vektor?");
             int antalelement = ci.readInt();
              System.out.println();
                   for (int j=0 ; j<antal-1; j++)
                   System.out.print("Ange vektor1: ");
                   int vektor = ci.readInt();
                   int vektor3 = ci.readInt();
                   int vektor2 = ci.readInt();
                   int vektor4 = ci.readInt();
                   int vektor5 = ci.readInt();
                   int[] vektor1 = new int[] {vektor,vektor3, vektor2, vektor4, vektor5};
                  int langd = vektor1.length;
                  System.out.print("Ange vektor2: ");
                   int element1 = ci.readInt();
                   int element2 = ci.readInt();
                   int element3 = ci.readInt();
                   int element4 = ci.readInt();
                   int element5 = ci.readInt();
                   int[] vektor21 = new int[] {element1,element2,element3, element4, element5};
                   Arrays.sort (vektor21);
                    int  kopiera = vektor1.length + vektor21.length;
                             int[] nyvektor = new int [kopiera];
                              for(int i = 0; i < vektor1.length; i++)
                                   nyvektor[i] = vektor1;
                             for(int i = 0; i < vektor21.length; i++)
                                  nyvektor[vektor1.length + i] = vektor21[i];
              System.out.print("Unionen ar: ");
                                  verktyg.sort(nyvektor);
                                  int counter = 0;
                                  for(int k = 1; k < nyvektor.length; k++)
                                  if(nyvektor[k] == nyvektor[k-1])
                                  counter++;
                                  int[] union = new int[nyvektor.length - counter];
                                  union[0] = nyvektor[0];
                                  int b = 1;
                                  for(int k = 1; k < nyvektor.length; k++)
                                  if(nyvektor[k] != nyvektor[k-1])
                                                           union[b] = nyvektor[k];
                                                           b++;
                                                           for (int h = 0; h<union.length; h++)
                                                           System.out.print(" " +union[h]);
    System.out.println();
    System.out.print("Intersection ar: ");
    Arrays.sort(nyvektor);
                   int counter1= 0;
              for(int i = 1; i < nyvektor.length; i++)
              if(nyvektor[i] == nyvektor[i-1])
              counter1++;
                   int[] intersection = new int[counter1];
              //c[0] = C[0];
              int a = 0;
              for(int i = 1; i < nyvektor.length; i++)
              if(nyvektor[i] == nyvektor[i-1])
                                       intersection[a] = nyvektor[i];
                                       a++;
                        for(int i=0; i<intersection.length; i++)
                                       System.out.print(" " +intersection[i]);
    System.out.println();
    System.out.println("Differensen ar: ");
    Arrays.sort(nyvektor);
         int counter2 = 0;
                        for(int i = 1; i < nyvektor.length; i++)
                        if(nyvektor[i] == nyvektor[i-1])
                        counter2++;
                             int[] difference = new int[vektor1.length-counter];
                                                 boolean falsk = false;
                                                 int k=0;
                                                 for(int i = 0; i < vektor1.length; i++)
                                                      for(int d=0; d<vektor21.length; d++)
                                                                if(vektor1[i]!=vektor21[d])
                                                                     falsk = true;
                                                                else
                                                                     falsk = false;
                                                                     break;
                                                                if(falsk)
                                                                     difference[k] = vektor1[i];
                                                                     k++;
                                            for(int i=0; i<difference.length; i++)
                                  System.out.print(difference[i] + " ");

    How about this?import java.util.*;
    import java.io.*;
    class DynamicVectors
      public static void main (String[] args)
        BufferedReader console
          = new BufferedReader (new InputStreamReader (System.in));
        String consoleLine = "";
        StringTokenizer tokenizer;
        System.out.print ("Hur m�nga Vektorer ska lagras? ");
        try
          consoleLine = console.readLine();
        catch (IOException ioe)
          System.out.println (ioe);
        tokenizer = new StringTokenizer (consoleLine);
        int antal = Integer.parseInt (tokenizer.nextToken());
        if (antal<2)
          System.out.println("Du beh�ver 2 st vektorer");
        for (int j=0 ; j<antal-1; j++)
          int vektorSize;
          System.out.print("Ange vektor1: ");
          try
            consoleLine = console.readLine();
          catch (IOException ioe)
            System.out.println (ioe);
          // Here's where the fun starts...
          tokenizer = new StringTokenizer (consoleLine);
          vektorSize = tokenizer.countTokens();
          int[] vektor1 = new int [vektorSize];
          for (int i = 0; i < vektor1.length; ++i)
            vektor1 = Integer.parseInt (tokenizer.nextToken());
    // ...and that's all there is to it.
    int langd = vektor1.length;
    System.out.print("Ange vektor2: ");
    try
    consoleLine = console.readLine();
    catch (IOException ioe)
    System.out.println (ioe);
    // Here's where the fun starts...
    tokenizer = new StringTokenizer (consoleLine);
    vektorSize = tokenizer.countTokens();
    int[] vektor21 = new int [vektorSize];
    for (int i = 0; i < vektor21.length; ++i)
    vektor21 [i] = Integer.parseInt (tokenizer.nextToken());
    Arrays.sort (vektor21);

  • A basic question/problem with array element as undefined

    Hello everybody,
    thank you for looking at my problem. I'm very new to scripting and javaScript and I've encountered a strange problem. I'm always trying to solve all my problem myself, with documentation (it help to learn) or in the last instance with help of google. But in this case I am stuck. I'm sure its something very simple and elementary.
    Here I have a code which simply loads a text file (txt), loads the content of the file in to a "var content". This text file contents a font family name, each name on a separate line, like:
    Albertus
    Antenna
    Antique
    Arial
    Arimo
    Avant
    Barber1
    Barber2
    Barber3
    Barber4
    Birch
    Blackoak ...etc
    Now, I loop trough the content variable, extract each letter and add it to the "fontList[i]" array. If the character is a line break the fontList[i] array adds another element (i = i + 1); That's how I separate every single name into its own array element;
    The problem which I am having is, when I loop trough the fontList array and $.writeln(fontList[i]) the result in the console is:
    undefinedAlbertus
    undefinedAntenna
    undefinedAntique
    undefinedArial ...etc.
    I seriously don't get it, where the undefined is coming from? As far as I have tested each digit being added into the array element, I can't see anything out of ordinary.
    Here is my code:
    #target illustrator
    var doc = app.documents.add();
    //open file
    var myFile = new File ("c:/ScriptFiles/installedFonts-Families.txt");
    var openFile = myFile.open("r");
    //check if open
    if(openFile == true){
        $.writeln("The file has loaded")}
    else {$.writeln("The file did not load, check the name or the path");}
    //load the file content into a variable
    var content = myFile.read();
    myFile.close();
    var ch;
    var x = 0;
    var fontList = [];
    for (var i = 0; i < content.length; i++) {
        ch = content.charAt (i);
            if((ch) !== (String.fromCharCode(10))) {
                fontList[x] += ch;
            else {
                x ++;
    for ( i = 0; i < fontList.length; i++) {
       $.writeln(fontList[i]);
    doc.close (SaveOptions.DONOTSAVECHANGES);
    Thank you for any help or explanation. If you have any advice on how to improve my practices or any hint, please feel free to say. Thank you

    CarlosCantos wrote an amazing script a while back (2013) that may help you in your endeavor. Below is his code, I had nothing to do with this other then give him praise and I hope it doesn't offend him since it was pasted on the forums here.
    This has helped me do something similar to what your doing.
    Thanks again CarlosCanto
    // script.name = fontList.jsx;
    // script.description = creates a document and makes a list of all fonts seen by Illustrator;
    // script.requirements = none; // runs on CS4 and newer;
    // script.parent = CarlosCanto // 02/17/2013;
    // script.elegant = false;
    #target illustrator
    var edgeSpacing = 10;
    var columnSpacing = 195;
    var docPreset = new DocumentPreset;
    docPreset.width = 800;
    docPreset.height = 600;
    var idoc = documents.addDocument(DocumentColorSpace.CMYK, docPreset);
    var x = edgeSpacing;
    var yyy = (idoc.height - edgeSpacing);
    var fontCount = textFonts.length;
    var col = 1;
    var ABcount = 1;
    for(var i=0; i<fontCount; i++) {
        sFontName = textFonts[i].name;
        var itext = idoc.textFrames.add();
        itext.textRange.characterAttributes.size = 12;
        itext.contents = sFontName;
        //$.writeln(yyy);
        itext.top = yyy;
        itext.left = x;
        itext.textRange.characterAttributes.textFont = textFonts.getByName(textFonts[i].name);
        // check wether the text frame will go off the bottom edge of the document
        if( (yyy-=(itext.height)) <= 20 ) {
            yyy = (idoc.height - edgeSpacing);
            x += columnSpacing;
            col++;
            if (col>4) {
                var ab = idoc.artboards[ABcount-1].artboardRect;
                var abtop = ab[1];
                var ableft = ab[0];
                var abright = ab[2];
                var abbottom = ab[3];
                var ntop = abtop;
                var nleft = abright+edgeSpacing;
                var nbottom = abbottom;
                var nright = abright-ableft+nleft;
                var abRect = [nleft, ntop, nright, nbottom];
                var newAb = idoc.artboards.add(abRect);
                x = nleft+edgeSpacing;
                ABcount++;
                col=1;
        //else yyy-=(itext.height);

  • How do I access array elements in one method from another method?

    Hi all!
    How do I access the array's elements from another method so that method 2 can have access to method 1's array elements? Thanks for any help!
    I am trying to create a simply program that will use a method to create an array and a SEPARATE method that will sort the array's elements (without using java's built in array features). I can create the program by simply having one method and sorting the array within that same method, BUT I want to sort the array from another method.
    Here's my code so far:
    public class ArraySort {
       public static void createArray(int size){
           double myArray[] = new double[size];    //create my new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);   //fill the array with random numbers
       public static void sortArray(){
           // I WANT THIS METHOD TO ACCESS THE ARRAY ELEMENTS IN THE METHOD ABOVE, BUT DON'T KNOW
          //  HOW???? Please help!
        public static void main(String[] args) {
            createArray(4);    //call to create the array
    }Thanks again!
    - Johnny

    Thanks for the help all! I ve managed to get the program working, using java's built in array sort, but when i try to call on the array sort method from WITHIN my main method, nothing happens!
    Can somebody please tell me why I am not able to call on the sort method from within my main class???? Thanks!
    public class ArraySort {
       public void createArray(double[] arrayName, int size){
           double myArray[] = new double[size];  //create new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);    //populate array with
           }                                                 //random Numbers
           sortArray(myArray); 
       } //Sort array(if I delete this & try to use it in Main method --> doesn't work???
       public void sortArray(double[] arrayName){
           DecimalFormat time = new DecimalFormat("0.00");
           Arrays.sort(arrayName);      //sort array using Java's built in array method
           for(int i = 0; i <arrayName.length; i++)
               System.out.println(time.format(arrayName)); //print arary elements
    public static void main(String[] args) {
    ArraySort newArray = new ArraySort(); //create a new instance
    double myArray[] = new double[0]; //create a new double array
    newArray.createArray(myArray,4); //build the array of indicated size
    //newArray.sortArray(myArray); //This will not work???? WHY?????//

  • How do I programmat​ically modify array element sizes?

    Hi All,
    I have a quick question about modifying the size of array elements. Hopefully someone can help, because I am at a dead end!
    I am logging some intensities from a Fibre Array using a camera. For calibration of the system, I acquire an image from the camera, click points on the image to divide it into areas of interest. I overlay my image with a grid showing the regions of interst - for example a 4x6 array. I then have to select the fibres - or ROIs - I want to log from.
    I have a cluster type-def ( a number and a boolean) to specify the fibre number and to turn logging from that fibre on/off. I overlay an (transparent) array of this typedef over my image to correspond with the regions of interest. So here's my problem - I want to modify the dimensions of the array so each control matches my ROI. I can resize the elements by rightclicking on the elements on the frontpanel, but can't find a way to do it programmatically. The Array Property Node>>Array Element>>Bounds won't 'change to write'...thats the first thing I tried.
    Its really only important that the elements align with my ROIs - so programmatically adding in gaps/spacings would also work for me...but again I can't figure out how to do this! I've attached a screenshot of part of my image with array overlaid to show you all exactly what my problem is.
    Thanks in advance for you help,
    Dave
    PS I am running Labview 8.6 without the vision add on.
    Solved!
    Go to Solution.
    Attachments:
    Array_Overlay.png ‏419 KB

    Here's my cheat (and cheap?) way If you want to get fancy and center the numeric and boolean indicators, you could add spacers on the north and west sides, too.
    Attachments:
    ClusterSpacer.vi ‏13 KB

  • How can I display all results of a array element in a TS2.0 NumericArrayMeasurement in a single report line?

    TestStand2.0 generates for each result property ( data, limits, status...) of each array element in a NumericArrayTest an extra line in the test report.
    How can I change this to display all result properties of one array element in a single line?
    How can I reduce the spaces between the property name and its value in the report?
    How can I delete the message: "Measurement[x]" and display only the Measurement Alias (named in the Edit Limits menu)?
    This means I like to change my report from:
    Measurement[0] (ADC1):
    Data: 5000
    Status: Passed
    Measurement[1] (AD
    C2):
    To:
    ADC1: Data: 5000 Status: Passed
    ADC2: ...

    Hi,
    What you can do, is use the Override Callbacks for Modify the Report that is Generated.
    Also you can also change the report sequence 'reportgen_txt.seq' to achieve the desired affect. If you go for modifying the report sequence then copy this to the User folder and then make your changes.
    In the Resources Library you can find simple examples were the report has been modified by either using the Override Callbacks or by modifying the actual sequence.
    One other item in the Report Options you will have to set the 'Select a Report Generator for Producing the Report Body' control to use the Sequence instead of the DLL.
    Hope this helps
    Ray Farmer
    Regards
    Ray Farmer

  • How to use XSLT for mapping feild names one by one to array element

    I have a XSLT case to map all the attributes feild name(not value) which has no child to the target, which is array loop.
    I give an sample below.
    source:
    <Items xmlns="http://www.example.org/sample">
    <SourceSystem>SourceSystem2573</SourceSystem>
    <TimeStamp>2010-01-17T20:54:08.234</TimeStamp>
    <Item>
    <ID>2574</ID>
    <Type>2575</Type>
    <Name>2576</Name>
    </Item>
    </Items>
    source XSD like:
         <element name="Items" type="tns:ItemsType"></element>
         <complexType name="ItemsType">
              <sequence>
                   <element name="SourceSystem" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="TimeStamp" type="dateTime" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Item" type="tns:ItemType"
                        maxOccurs="unbounded" minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    <complexType name="ItemType">
              <sequence>
                   <element name="ID" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Type" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    <element name="Name" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    target need to be like:
    <ns1:AttributesCollection>
    <ns1:Attributes>
    <ns1:fieldname>SourceSystem</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>TimeStamp</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>ID</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Type</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Name</ns1:fieldname>
    </ns1:Attributes>
    </ns1:AttributesCollection>
    target XSD:
    <xs:element name="AttributesCollection" type="AttributesCollection"/>
    <xs:complexType name="AttributesCollection">
    <xs:sequence>
    <xs:element name="Attributes" type="Attributes" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Attributes">
    <xs:sequence>
    <xs:element name="fieldname" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    I know we can use local-name() to get the tag/field name,
    but I have not idea how to get these leaf field names one by one and then mapping to every array elements.
    I tried whole day but no successful
    Does anyone have some idea?
    Thanks very much!
    Keith
    Edited by: user1065212 on 17-Jan-2010 22:50
    Edited by: user1065212 on 17-Jan-2010 22:53
    Edited by: user1065212 on 17-Jan-2010 22:59

    can you paste source xsd and the correct xml output, the current one isn't really valid
    <ID>2574</TotalNumOfItems>

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • How to change the color of Numeric array elements (seperatel​y) programmat​ically using property node??

    For example, i have 3 numeric controls, controlling 3 numeric array elements (Numeric control is connected directly to indicator). Then if i change value in numeric control 1, then the array element No.1 of numeric array should turn red when value exceeds 5. Similarly when i change num control 2 then element 2 of array should turns red when value in num control 1 exceeds 10. Similarly for 3rd element. In other words, i want to control the property of array elements individually through seperate numeric control.
    I have done it for single numeric indicator.i.e. when i change numeric control's values then a single numeric indicator changes values and color (Numeric text BG property) but with array, the color of whole array changes but i want to change color of singles element of array.
    Please help thanks.  
    Solved!
    Go to Solution.

    ...or replace the numerics with clusters that have a numeric and a color box. make the background of the nmeric transparent and slide the color box behind the numeric. Use the color box to control the background color.
    Other alternatives would use a cluster instead of the array or if your req's are really weird "roll-your-own" with a Picture control.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • "In initializer for 'mxmlContent', type Object is not assignable to target Array element type..."

    Hi all,
    So I've have built an application on flash builder 4.5 using Christophe Coenraets' tutorial "Building an EmployeeDirectory" (http://www.adobe.com/devnet/flex/articles/employee-directory-android-flex.html#articlecont entAdobe_numberedheader).
    I'm getting this error message "In initializer for 'mxmlContent', type Object is not assignable to target Array element type mx.core.IVisualElement." and then the debugger highlights my code this line of my code "</s:List>" in my EmployeeDetails.mxml file. This started after I coded Part 5, Step 2 "Integrating with the Device Capabilities: Triggering the Actions".   The rest of the code debugged fine.
    I think it relates to Christophe's note "Note: Make sure you import spark.events.IndexChangeEvent (and not mx.events.IndexChangedEvent) for this code to compile.".  I don't know where to place this
    " import spark.events.IndexChangeEvent;" line of code. 
    Any help?  Tks in advance..
    Any help would be greatly appreciated.  Thanks

    You have a DataGrid directly inside a State element. Perhaps wrap it in an AddChild element?
    More information on using states can be found here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=using_states_1.html

  • Display a particular array element on the front panel

    Hello,
    I was wondering if it's possible to change which element of an array control is displayed on the front panel from within the program.
    Here's why I want to do it: I have an array of clusters, each of which contains a set of controls.  The controls in each cluster specify a bunch of different parameters for a few different instruments that are being controlled by Labview.  The user changes all the values on the front panel before the program starts, then the program steps through the array elements one by one.  I'd like to be able to change the array's display so that the user can know which set of parameters is active (and thus what is currently in force) while the program is going -- otherwise the element that is displayed is just wherever the user left it last.
    Thanks in advance for any help.

    See also: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=317419#M317419
    LabVIEW Champion . Do more with less code and in less time .

  • 'Incorrect value type for array element in index N'

    Please help.  Preflight is flagging multiple 'Incorrect value type for array element in index N" > Required key /F is missing >Array element at index 0 is of wrong type' messages for pages throughout my text document with embedded navigation and annotations.What does it mean? Is there anything I can do?
    The origins of the file are from a selection of emails taken from Mail and gmail, and letters probably written on pc (Office) and converted to pdf...
    I'm on Mac Mavericks.
    Thanks for reading.

    What problem are you trying to solve with preflighting? What are you checking for?

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Deleting array elements

    Hi!
    I have a problem with my program. i have an array and in this array a several numbers. With the "In Range and Coerce" function i want to prove if the the array element is inside or outside of my limitations. If my array element is in the outside of my limitation, the code in the case structure should delete this element.
    I need this program, because the array is displayed on a graph and i want only display the date, which is in the limitations.
    I hope somebody could help me!
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    array.jpg ‏54 KB

    Hallo Peter
    Das Problem tritt auf, weil du immer wieder das selbe Array liest.
    Die Knoten am Loop sollten Shift-Register sein, damit das Array, bei dem das Element gelöscht wurde, bei der nächsten Iteration gelesen wird. Allerdings musst du dann auf einen While-Loop umstellen, da du ansonsten Elemente lesen willst, die es im Array nicht mehr gibt.
    Anbei eine mögliche Lösung.
    Hoffe es hilft weiter.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    RemoveElements.vi ‏32 KB

Maybe you are looking for

  • Java Exception in Main/Menu/Reporting Tools/XML Publisher/Report Definition

    Hi , One know this error : Java Exception: java.lang.NoSuchMethodError: oracle.xml.parser.schema.XSDBuilder.build(Ljava/io/InputStream;Ljava/net/URL;)Loracle/xml/parser/schema/XMLSchema;: during call of com.peoplesoft.pt.xmlpublisher.PSXPXsdUtils.get

  • Attachments in Advanced Table

    Hi, Facing an issue in adding attachments item through personalization. I personalized the seeded page for adding the attachment image in table. But while clicking the attachment image am getting the error as *"404 Not Found* *Resource /OA_HTML/null&

  • Editing Canon 7d 1080p/24 footage with Premiere Pro CS5 + mobile quad core CPUs

    I'm researching getting a new laptop for editing and trying to determine if even the best laptop out there will give me the editing experience I need. Does anyone have any experience editing 7d 1080p/24 video files in CS5 with a laptop with a quad co

  • Macbook to Snow Leopard with Macbook Pro Discs

    My dad has a MacBook Pro 13 in. with Snow Leopard on it and I have a regular MacBook from 2006 with Leopard on it. Can I use his re-install discs to install Snow Leopard on my computer? If so, what do I need to do before? Full backup?

  • VERY URGENT IPHOTO QUESTION PLEASE HELP!!!

    Good day. i know this is an ihpoto question which should be posted in the iphoto section- but due to its urgency i really need all the help i need.- I would like to create a slide show presentation with music attached to it. i tried it once with a fe