Storing an Array in a SharedObject

Hello again, kind and helpful people lol
I'm currently working towards using a SharedObject to store a player's stats in a game, such as total time played, etc and was wondering if it was possible to create an Array in the shared object in order to group collections of similar data? If so then how would I go about initializing it?
Would this work?
var mySharedObject = SharedObject.getLocal("sharedObjectName");
if(!mySharedObject.data.arrayName)
mySharedObject.data.arrayName = new Array();
mySharedObject.data.arrayName[0] = 0;
If so then that's a lot easier than I was expecting it to be! Thanks in advance for any feedback/advice

Yes, that should work - and if you look in the Help for the data property of the SharedObject class,
you will see there's an example using an array just like you're showing.

Similar Messages

  • Storing an array of checkbox booleans into preferences and retrieving them

    Just wondering how to go about storing an array of JCheckBoxes into a preference and retrieving it. There's 32 checkboxes so if they select, say, 6 of these randomly it should store it in a preference file and retrieve it when the application is loaded so that the same 6 checkboxes remain selected. I'm currently getting a stack overflow error, though.
    import java.util.prefs.*;
    public class Prefs {
         Preferences p;
         GUI g = new GUI();
         public Prefs() {
              p = Preferences.userNodeForPackage(getClass());
              g = new GUI();
         public void storePrefs() {
              for (int i = 0; i < g.symptoms.length; i++) {
                   p.putBoolean("symptoms", g.symptoms.isSelected());
         public void retrievePrefs() {
              for (int t = 0; t < g.symptoms.length; t++) {
                   p.getBoolean("symptoms", g.symptoms[t].isSelected());
    symptoms is the array of checkboxes in the GUI class. Not sure where I am going wrong here. I can do it with strings from textfields etc but this is proving to be an annoyance. :(
    Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Actually, I have a better example, see below
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.util.prefs.*;
    public class PreferencesTest {
        private Preferences prefs;
        public static final String PREF_OPTION = "SELECTED_MENU_ITEM";
        public void createGui() {
            prefs = Preferences.userNodeForPackage(this.getClass());
            JMenuItem exitAndCloseMenuItem = new JMenuItem("Exit");
            exitAndCloseMenuItem.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
            JMenu fileMenu = new JMenu("File");
            fileMenu.add(exitAndCloseMenuItem);
            JCheckBoxMenuItem[] preferenceItems = {
                new JCheckBoxMenuItem("pref 1"),
                new JCheckBoxMenuItem("pref 2"),
                new JCheckBoxMenuItem("pref 3"),
                new JCheckBoxMenuItem("pref 4")};
            int selectedMenuItem = prefs.getInt(PREF_OPTION, 0);
            preferenceItems[selectedMenuItem].setSelected(true);
            ButtonGroup preferencesGroup = new ButtonGroup();
            JMenu preferenceMenu = new JMenu("Preferences");
            for(int i = 0;i<preferenceItems.length;i++){
                preferenceItems.setActionCommand(Integer.toString(i));
    preferenceItems[i].addActionListener(new menuItemActionListener());
    preferencesGroup.add(preferenceItems[i]);
    preferenceMenu.add(preferenceItems[i]);
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(fileMenu);
    menuBar.add(preferenceMenu);
    JFrame f = new JFrame("Prefernce Test");
    f.setJMenuBar(menuBar);
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    public static void main(String[] args){
    new PreferencesTest().createGui();
    class menuItemActionListener implements ActionListener{
    public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem jcbm = (JCheckBoxMenuItem)e.getSource();
    prefs.put(PREF_OPTION, jcbm.getActionCommand());

  • Storing an array permanently

    Hi,
    Is there a way of storing an array permanently, so that it stays saved somewhere in a file or something? I need to create an application that stores this array and reads the values from it, without having to re-create the array everytime I run the application.
    Thanks for any help.

    Serialization is flakey (can have many problems when JDK or class is updated), wasteful of space, and IMO should be the implementation of last resort.
    Here's a code snippet of what I would do:
    public void saveArray(Object[] array, File f) throws IOException {
      PrintWriter writer = new PrintWriter(new FileWriter(file));
      for (int i = 0; i < array.length; i++)
         writer.println(array.toString);
    writer.close();

  • Storing an array into the database using jdbc

    Hi,
    i�ve got a problem storing an array into a database. I want to store objects consisting of several attributes. One of these attributes is an array containing several int values. I don�t know exactly what is the best way to store these objects into a database. I have created two tables connected by a one to many relationship of which one stores the array values and the other table stores the object containing the array. Is that ok or should I use another way. It�s the first time I�m trying to store objects containing arrays into a database so I�m very uncertain in which way this should be done.
    Thanks in advance for any tips

    1. You should use blob or longvarbianry type colum to stor that array.
    2. All object in that array should be Serializable.
    3. Constuct a PreparedStatement object
    4. Convert array to byte[] object
    ByteArrayOutputStream baos=null;
    ObjectOutputStream objectOutputStream=null;
    baos = new ByteArrayOutputStream(bufferSize);
    objectOutputStream = new ObjectOutputStream(baos);
    objectOutputStream.writeObject(array);
    objectOutputStream.flush();
    baos.flush();
    byte[] value=baos.toByteArray();
    5. Now you can use PreparedStatement.setBytes function to insert byte[] value.

  • Best Practice: Storing an array in MySQL

    Hi,
    I'm working on an app that uses Flex 2, Coldfusion and MySQL.
    I'd like to store an array (or in this case an ArrayCollection)
    into my db. I'm not totally sure if I can do this. I read something
    about PHP having an implode command but I'm wondering what the best
    practice would be for trying to get an array into MySQL via
    ColdFusion.
    I'd be grateful for any advice.
    Novian

    Thanks, mike_the_maven.
    I'm not familiar with that tag but I'll definitely look into.
    I'm also wondering about potentially storing my ArrayCollection as
    a BLOB in MySQL. Any thoughts about this approach?
    Thanks.
    Novian

  • User to enter values and stored as array

    Hi,
    I have some problem with my labs that I would like to clear by doubt.
    I need a user to keyed in a list of age so to calculate the average age. The values entered is stored in into an Array (not arrayList) I have been using ArrayList rather than array. =(
    So I have used a bufferedReader to capture the input the user keyed in. unlike arraylist, I could not create an array without knowing the size of it.
    Also,
    My following code has some proble, when I run the program and enter 99 as the first value input. The system would terminate. However, when I enter other values than 99, the system would not terminate. Do point out my brainless mistake. Thanks alot.
      public static void main(String[] args) {
             // TODO, add your application code
            int num =0;
             int j = 0;
      boolean stop = false;
              int[] arr = new int[200];
               BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                  while(stop == false){
               try {
             num =  Integer.parseInt(br.readLine());
          } catch (IOException ioe) {}
          if(num == 99){
          stop = true;
        arr[j] = num;
        j++;
        }

    seah_ly wrote:
    I need a user to keyed in a list of age so to calculate the average age. The values entered is stored in into an Array (not arrayList) I have been using ArrayList rather than array. =(Yes you are correct in using an ArrayList, however if arrays are required you could mimic the actions of a growing ArrayList by using an array and initializing a new array with double the size of the old array and copying the old elements to the new array. Note this is exactly what an ArrayList does.
    My following code has some proble, when I run the program and enter 99 as the first value input. The system would terminate. However, when I enter other values than 99, the system would not terminate. Do point out my brainless mistake. Thanks alot.
    if(num == 99){
      stop = true;
    }What do you think this does to the while loop?
    Mel

  • Storing 2d array in ArrayList?

    Hi I'm storing a 2d int array (int[][]) in an ArrayList. But I cant convert it back to a 2d array again.
    Tried:
    indices.add(option.getIndexList());
    indices.add(option[j].getIndexList());
    int[][] Arr = (int[][])indices.toArray(new int[indices.size()][2]);

    If you put a 2-d array into an ArrayList, then toArray would make a 3-d array--a 1-d array of 2-d arrays.
    However, I don't think you can use toArray to get a primitive array. If you look at the API, it requires an object. I think you'll have to do this to get each array:
    int [][] arr = (int[][])indices.get(0);If you want the 3-d array, you can do it manually.

  • Storing an array of integers in a session

    using the following code:
    int stateCount = 50;
    int[] stateId = new int[stateCount];
    for(int i = 0; i<stateCount;i++){
    stateId[i] = i + 1;
    //so far this all works
    //my problem     
    session.setAttribute("stateId", stateId);
    int[] session_statesId = (int[]) session.getAttribute("statesId");
    System.out.print(session_statesId.length);
    //using this code I recieve an error. I have been able to so this storing a String array in a session but I can't figure out why the int is not working any suggestions?

    that's an easy one: you do not use the same id for storing and retrieving. ever thought of using a defined constant?
    private final static String STATES_KEY = "statesId";
    robert

  • Retrieve LV stored 2D-Array via MySQL C-API

     Hello everybody!
    I am not quite sure, if this is the right place for my question, but I'll just give it try.
    I have a LabVIEW Vi which performs Data Acquistion-Tasks. The Data is stored in a MySQL-Database using the Labview Database Connectivity Toolset. One part of the stored data is a 2D-Double-Array. For storage in MySQL It is automatically converted to Binary Data and the stored in a MySQL Blob-Field.
    Unfortunately, the software to process the data is written in C++. It was fairly easy to establish the communication between my c++ application and MySQL via the MySQL C-API. But now i'm struggling to retrieve the Binary-Data from the Database and reconvert it into a C++ Double Array, as am not very experienced with C++.
    Has anyone done something similar before?

    Hello
    I am happy to hear that your LabVIEW application and data storage with the LabVIEW Database Connectivity Toolkit works.
    Unfortunately is this the wrong platform to ask about C++. There are many other open platforms discussing C questions. I’d propose you to ask your question there.
    Best Regards
     Daniela Biberstein
    NI Switzerland

  • Vector (good for storing) and arrays(good for numerical sums, multiplying)

    Hi guys, I am trying to use vectors because I need a variable lenght and store 2D arrays in one coordenate of a vector. That is why I am using vector instead arrays. I can turn the type of variable using "Integer" (instead of "int" as arrays), "Double" (instead of "double") and so on. The problem is that it doesn't allow me to operate, it is very good for storing, but I need to be able to operate, multiplying, sum, etc the elements there are in the coordenates. And I think it is not possible.
    What u think about it? I can only store stuff ion a vector, I cannot operate. Besides I cant turn a data from "Double" to "double", I can either use arrays OR vectors, but not both of them at the same time.
    You think i am wrong?, because I mean in that case, Java is not very useful to do this numerical problem.
    Thanks.
    This is only a class of the program I am doing.
    import java.util.*;
    class SolveDomain {
         int newton_iter = 0, m = 0, work_count = 0;
         double t = 0, dx, dy, dt, start_t=0;
         double[][] v;
    Details obDetails = new Details();
         public double[][] solveDomainMethod(Double vAxn, Double vAyn, Double vBxn, Double vByn, Integer nxn, Integer nyn, double dt, Double error1n, Double error2n, double end_tn, int stepsn, Integer kcn, Double u_n[][], Double v_n[][], Double bc1, Double bc2, Double bc3, Double bc4, double u[][]) {       
         double dx2, dy2, err = 1000000;
         v = new double[nxn+1][nyn+1];
         DoublevAxn, Double vAyn, Double vBxn, Double vByn, Integer nxn, Integer nyn, double dt, Double error1n, Double error2n, double end_tn, int stepsn, Integer kcn, double u_n[][], double v_n[][], Double bc1, Double bc2, Double bc3, Double bc4;
    double k[][] = new double [nxn+1][nyn+1]; double kp[][] = new double [nxn+1][nyn+1];
    double kpp[][] = new double [nxn+1][nyn+1]; double dudx[][] = new double [nxn+1][nyn+1];
    double dudy[][] = new double [nxn+1][nyn+1]; double d2udx2[][] = new double [nxn+1][nyn+1];
    double d2udy2[][] = new double [nxn+1][nyn+1]; double dudt[][] = new double [nxn+1][nyn+1];
    double a[][] = new double [nxn+1][nyn+1]; double b[][] = new double [nxn+1][nyn+1];
    double c[][] = new double [nxn+1][nyn+1]; double d[][] = new double [nxn+1][nyn+1];
    double F[][] = new double [nxn+1][nyn+1]; double A[][] = new double [nxn+1][nyn+1];
    double B[][] = new double [nxn+1][nyn+1]; double C[][] = new double [nxn+1][nyn+1];
    double D[][] = new double [nxn+1][nyn+1]; double E[][] = new double [nxn+1][nyn+1];
    double s[][] = new double[nxn+1][nyn+1];
              KDerivatives1 obK1 = new KDerivatives1();
              KDerivatives2 obK2 = new KDerivatives2();
    UDerivatives obU = new UDerivatives();
              CalcPdeCoefficients obPde = new CalcPdeCoefficients();
              CalcFdCoefficients obFd = new CalcFdCoefficients();
              Gs obGs = new Gs();
    dx = obDetails.seg(vBxn, vAxn, nxn);
    dy = obDetails.seg(vByn, vAyn, nyn);
    dx2 = dx*dx;
    dy2 = dy*dy;
    if (bc1 != -999999999) obDetails.initialiceBCDomainL(dx, dy, vAxn, vAyn, bc1, u);
    if (bc2 != -999999999) obDetails.initialiceBCDomainU(dx, dy, vAxn, vAyn, bc2, u);
    if (bc3 != -999999999) obDetails.initialiceBCDomainR(dx, dy, vAxn, vAyn, bc3, u);
    if (bc4 != -999999999) obDetails.initialiceBCDomainD(dx, dy, vAxn, vAyn, bc4, u);
    obDetails.source(dx, dy, vAxn, vAyn, s);
    do {
    ++ newton_iter;
    if (kcn == 1) { 
              obK1.calc_k(u, k);
         obK1.calc_kp(u, kp);
         obK1.calc_kpp(u, kpp);
              } else {
                   obK2.calc_k(u, k);
              obK2.calc_kp(u, kp);
              obK2.calc_kpp(u, kpp);
                   obU.calc_dudx(u, dx, dudx);
              obU.calc_dudy(u, dy, dudy);
                   obU.calc_d2udx2(u, dx2, d2udx2);
                   obU.calc_d2udy2(u, dy2, d2udy2);
              obU.calc_dudt(u, u_n, dt, dudt);
              obPde.calcPdeCoefficientsa(k, a);
              obPde.calcPdeCoefficientsb(kp, dudx, b);
              obPde.calcPdeCoefficientsc(kp, dudy, c);
              obPde.calcPdeCoefficientsd(kp, kpp, dudx, dudy, d2udx2, d2udy2, d);
              obPde.calcPdeCoefficientsF(k, kp, dudx, dudy, d2udx2, d2udy2, dudt, s, F);
              obFd.calcFdCoefficientsA(a, b, dx, dx2, A);
              obFd.calcFdCoefficientsB(a, b, dx, dx2, B);
              obFd.calcFdCoefficientsC(a, c, dy, dy2, C);
              obFd.calcFdCoefficientsD(a, c, dy, dy2, D);
              obFd.calcFdCoefficientsE(a, d, dx2, dy2, dt, E);
              obGs.gsMethod(v_n, A, B, C, D, E, F, dt, error2n, v);
              m = m + obGs.iter;
              for (int i=1; i < u.length - 1;i++ ) {
                   for (int j=1; j < u[0].length - 1 ;j++ ) {
         u[i][j] = u[i][j] + v[i][j];
    err = 0;
              for (int i=0; i < u.length ;i++ ) {
                   for (int j=0; j < u[0].length ;j++ ) {
                   err = err + Math.pow(v[i][j],2);
              err = Math.sqrt(err);
    while (err > error1n);
         return u;           
    public double[][] rectangleDomainF (Vector vAxvector, Vector vAyvector, Vector vBxvector, Vector vByvector, Vector nxvector, Vector nyvector, Vector error1vector, Vector error2vector, double end_t, int steps, Vector kcvector, double numberdomains, Vector bc1vector, Vector bc2vector, Vector bc3vector, Vector bc4vector) {
                   double u[][] = new double[u.length][u[0].length];
                   double dt = obDetails.seg(end_t, start_t, steps);
                   Vector uvector = new Vector();
                   Vector vvector = new Vector();
         do
    ++work_count;
              t = work_count * dt;
    for (int k = 0; k < numberdomains ; k++) {
         solveDomainMethod((Double)vAxvector.elementAt(k), (Double)vAyvector.elementAt(k), (Double)vBxvector.elementAt(k), (Double)vByvector.elementAt(k), (Integer)nxvector.elementAt(k), (Integer)nyvector.elementAt(k), dt, (Double)error1vector.elementAt(k), (Double)error2vector.elementAt(k), end_t, steps, (Integer)kcvector.elementAt(k), (Double [][]) uvector.elementAt(k), (Double [][]) vvector.elementAt(k), (Double)bc1vector.elementAt(k), (Double)bc2vector.elementAt(k), (Double)bc3vector.elementAt(k), (Double)bc4vector.elementAt(k), u);
                                                           uvector.insertElementAt(u, k);
              vvector.insertElementAt(v, k);
    while (t < end_t);
    return u;

    The only way to, for instance, multiply a Double object by another Double object is to convert them back to primitives, multiply them, and create a new Double instance:
    public Double multiply(Double lhs, Double rhs) {
       return new Double( lhs.doubleValue() * rhs.doubleValue() );
    }This is just an overhead that you have to accept if you want to use collections with primitive type data.
    Coming soon in 1.5 (which is in Beta now and available for download in the usual places) a new feature called auto-boxing will do a lot of this automatically for you. You need to be aware that it's doing exactly the same operations with the same performance overhead; but it does save a lot of typing.
    Thus in 1.5 the above becomes:
    public Double multiply(Double lhs, Double rhs) {
       // Under the hood this is IDENTICAL to the above example
       return lhs * rhs;
    }Now, addressing your post directly:
    Besides I cant turn a data from "Double" to "double"
    Yes you can, as in the first example, the doubleValue() method converts a Double object to a double primitive.
    Java is not very useful to do this numerical problem.
    If you need math performance, you need to use primitives, yes. Yes, that will preclude the use of collections.
    Dave.

  • Storing an array

    Hi
    I'm writing a GUI program in java and have a problem. I need to have an array filled with random numbers when one button is clicked, and the same array to be accessed when clicking another button. I tried to do this by using methods to pass the array, but i keep getting stuck. Is there another way to do this?
    if(e.getSource() == startButton)  // Start Question
                   int Nums[] = new int[50];
                   Nums = fillArray(Nums);
                   int x = 0;
                   Nums = arrayStore(Nums, x);
                   int n = Nums[1];
                   String q = Integer.toString(n);
                        displayArea1.setText(q);
              if(e.getSource() == listButton) // Get Question
                   int x = 1;
                   int Nums[] = new int[50];
                   Nums = arrayStore(Nums, x);
                   int a = Nums[1];
                  String b = Integer.toString(a);
                   displayArea1.setText(b);
                   String q = Questions(a);
                   String c = Choices(a);     
                   displayArea2.setText(q);
                   displayArea3.setText(c);
         static int[] fillArray(int qNum[])
              // Input array with numbers from 1 - 50
              for (int x=0; x<50; x++)
                   qNum[x] =  x;
              // Shuffle numbers randomly
              int x,y,z;
              Random generator = new Random();
              for (int i = 0; i<101; i++)
                    x = generator.nextInt( 49 );
                    y = generator.nextInt( 49 );
                    z = qNum[x];
                    qNum[x] = qNum[y];
                    qNum[y] = z;
              return qNum;
      // This is what i can't figure out! :
                 int[] arrayStore(int qNum[], int x)
              int[] storedNum = qNum;
              int[] tempNum;
                   String q = Integer.toString(x);
                   //displayArea1.setText(q);
                   if (x==0)
                        tempNum = qNum;
                   if (x==1)
                        return tempNum;
              return storedNum;
         }

    Well, this is what i'm trying to do.
    if(e.getSource() == startButton) // Start Question // ** BUTTON 1
         1) Empty array is created.
          2) Array is sent to fillArray method
          3) Array is sent to arrayStore method
    if(e.getSource() == listButton) // Get Question // ** BUTTON 2
       1) Empty array is created.
       2) Array is retrieved from arrayStore method.
    static int[] fillArray(int qNum[])
        1) Array is filled with random numbers and returned
    int[] arrayStore(int qNum[], int x)
        this is what needs to happen:
      1) When method is called by ** BUTTON 1, it saves the array passed to it.
      2) When method is called by ** BUTTON 2, it passes the saved array (from BUTTON1) to it (BUTTON2).
    }Hope that clears it up.
    Any ideas?

  • Storing an array of objects?

    Right... I need my table to store a series of product ID's, quantities, and serial numbers. At the moment, I'm using a column for each time, and using a StringTokenizer to retrieve them from strings such as "3;4;2;5". However, I'd like to store all 3 values in one column, so that I can store effectively an array of objects in one column field. Is this in any way possible?
    Thanks
    Stu

    Sorry, perhaps I wasn't clear enough.
    The table I am using is designed so that each row
    tracks a single technical services job (I'm writing
    this for a computer repair/maintenance firm). As such,
    I need to track what hardware items are used/sold with
    a tech services job.
    At the moment I have three columns:
    ProductID ProductSerial
    ProductQuantity
    1;2;3;4; 111;222;333;444;
    5;6;7;8
    The above three columns & values contain data for 4
    separate sales within the job:
    ProductID 1, serial 111, quantity 5
    ProductID 2, serial 222, quantity 6
    ProductID 3, serial 333, quantity 7
    ProductID 4, serial 444, quantity 8
    To generate the info for the first sale, I take the
    first token of all 3 columns, and so on, and then map
    them to a two-dimensional array that will look as
    follows:
    (assume they're all strings for now)
    String[][] sales = new String[][]
    new String[] { "1", "111", "5" },
    new String[] { "2", "222", "6"}
    }; This works as I want. However, I suspect there's a way
    to condense all three of my current columns into one
    column... one that I can't myself fathom, and would
    greatly appreciate help for.
    -fuzzy- how could I redesign the database to implement
    such a thing?
    All help appreciated
    Stuas pointed out the design is terrible.
    here is a proper design that will make your life much easier...
    Table - Sale
    id- Primary Key
    Table - SaleItem
    saleid - Foriegn Key from Sale - also part of Primary Key
    productid - other part of primary key
    productserial
    productquantiy
    so your data would look like this in these tables...
    Sale
    id
    1
    SaleItem
    saleid productid productserial productquantity
    1 1 111 5
    1 2 222 6
    1 3 333 7
    1 4 444 8
    as a side note i think productid is probably a spurious field.. using are using it i think as unique id... wouldn't the serial numbers be unique? I would use just them if they are...
    anyway hope this helps.

  • Storing an Array in the EncryptedLocalStore

    <!-- Fist of all, excuse my poor English, I'm doing my best. -->
    Hi ppl!
    I'm trying to store an array plenty of strings in the EncryptedLocalStore but it doesn't work. I think there is some kind of problem when retrieving data from the store and casting it into an array.
    There are no runtime/compilation errors but I can't read the strings I used to store.
    Here is the code I'm using to store the array:
    bytes = new ByteArray();
    bytes.writeObject(myArray) as Array;
    EncryptedLocalStore.setItem("arrayStored", bytes);
    And here, the code to read it:
    readArray = EncryptedLocalStore.getItem("arrayStored").readObject() as Array;
    Can someone help me? Thanks!

    Please, any trails or ideas?

  • Looping and storing into arrays

    Anyone managed this yet, or BC team - you got any thoughts....?
    There could be cases and situations like this one and in this case either a solution or just having a loop array filter would be nice also...
    Issue:
    You have a web app with classifications. You want to people in a company. You want to show board members (Classification) in one section and the rest of the team in another.
    The Rest of the team will show the board members because you do not have classifications in list view.
    Solution 1:
    BC to provide classifications in list view liquid/collection
    Solution 2: (And something we probably may need too)
    It would be great to loop through a collection and store into an array
    {% assign myarray = [] -%}
    {module_webapp collection="myitems"}
    {% for item in myitems-%}
         {% myarray | map: item.name-%}
    {% endfor -%}
    {{myarray}}
    It would be handy to be able to store items in an array. You can already map an array, have a manually made array you can loop through, have a string you map into an array via a cookie etc.

    Well Rob, you have {module_data... So if you want to go even further You can turn to that and you can defiantly do the where. I think bringing that to all modules would be some serious overkill work, you would be basically replicating that functionality.
    That is how I am classing _data - This is your hardcore module to use when you want to do some serious s*** but as I have said in other threads, We should not be turning to that all the time when we just need something like categories in list view. That would also be over kill in those situations.
    But then when you do use _data it would be good to get some results, map it to an array and then use that for something else.

  • LabView, Storing in array some dynamics variables (ENG - FR)

    (Version française plus bas)
    Hello,
    I have made a tiny .vi for using DAQ USB in analog acquisition of sine.
    I want to store each step of test in one array. But when I start a new measure , it erase the old one.
    Sorry for my bad english
    Bonjour,
    Je suis actuellement entrain de mesurer des dephasages grâce au DAQ de LabView. J'aimerai sauver mes différentses phases de test dans un tableau mais à chaque nouveau test les valeurs sont écrasées.
    Merci d'avance pour vos conseils
    Solved!
    Go to Solution.
    Attachments:
    Aquis_boucle_liught.vi ‏142 KB

    The stop button does not work because you have a dataflow problem. The stop button gets read exactly once at the start of the program, and then never again because the inner loops never stop. Once the inner loop starts, the outermost loop does not iterate until all inner loops have completed. This also means that the stop button will not get read. If you want a button to get the updated value inside an inner loop, the terminal needs to be inside the inner loop.
    If all three of your buttons are off, you have three inner loops that execute empty cases, each as fast as the computer allows, consuming all available CPU. The loops need a small wait. See also.
    You really need to learn about dataflow and design patterns. You code could be simplified dramatically. It is way to chopped up and inside out.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Erorr while attaching License to a user

    Dear All I get an error while attaching 'LICENSE' to the user. "XML PARSING FAILED (MESSAGE -60070-33). I had already attached license to 3 users and it's working fine. But all of a sudden when i am trying to assign license to new users it's giving m

  • Formated my mackbook, how to reinstall OS X?

    Hi! I was going to install Windows in BootCamp, but in some way i managed to formate my whole OS X disk. Now when I try to boot up my MacBook, it only shows a folder sign with a question mark inside of it. I've tried to boot it up from a USB stick by

  • Outgoing Payment

    Dear Experts I am making a Pld report on outgoing payment in which i  want to display payment method ..cash or bank.. how can i distinguish between  cash and  bank payment   because in OVPM  table when cash payment is made it stores G/L Code..in case

  • How to change Code, Name Lenght & Description

    Hi, How can I change the fields that are automatically generated when you create a Table? (Code & Name) I want to create tables with diferent kind of Key. For example: I want a date to be the key of a master file. I don´t need a name in this master f

  • Deployment Error on sap-j2ee engine

    Hi I build an EJB project,Web project and added these to EAR project and built an '.ear' file. When i tried to deploy on sapj2ee engine. I got the following deployment error. My j2ee engine is up and running. What went wrong? Help me, Thanks ========