Error in a while loop formula

I am trying to use a while loop formula to show the characters in a field up to the open parentheses '(', however I am recieving an error message saying: 'A subscript must be between 1 and the length of the string.'_
There are values in the field that will not have any perentheses at all, such as 'N/A' and I think this may be what is returning the error??  My original formula is:
local NumberVar i:=1;
Local StringVar Severity;
while {Issue_Lookups_1.Name}<i><> '(' do
(if {Issue_Lookups_1.Name}<i><> '(' then Severity:= Severity + {Issue_Lookups_1.Name}<i>;
i:= i+1);
Severity
I also tried this variation, creating a secong formula to exclude any values = to N/A
First formula:
if {Issue_Lookups_1.Name}<> "N/A" then {Issue_Lookups_1.Name} else ''
While Loop formula:
local NumberVar i:=1;
Local StringVar Severity;
while {@Severity<>N/A}<i><> '(' do
(if {@Severity<>N/A}<i><> '(' then Severity:= Severity + {@Severity<>N/A}<i>;
i:= i+1);
Severity

Try this
local NumberVar i:=1;
Local StringVar Severity;
while not({@SeverityN/A} <i>= '(') do
(if not({Issue_Lookups_1.Name} ='(' ) then Severity:= Severity + {Issue_Lookups_1.Name};
i:= i+1);
Severity
Regards,
Raghavendra
Edited by: Raghavendra Gadhamsetty on Feb 11, 2009 6:56 PM

Similar Messages

  • While loop error

    I can't seem to find the soultion to the following error message:
    G:\UOP\POS 406\Java Assignements\Week 3, Assignment 2\MortgageCalcV1.java:53: variable option might not have been initialized
                   while ((option == 'Y') || (option == 'y'))
                   ^
    1 error
    Tool completed with exit code 1
    The following is my code starting with the while line to the end of while statement:
    //While statement to prompt user to continue to use calculator or to quit.
                   while ((option == 'Y') || (option == 'y'))
                   {  //begin loop
                        System.out.print("Enter the amount to be financed: $");
                        StrPrincpal = dataIn.readLine (); //Places data into the string StrPrincpal
                        princpal = Double.parseDouble (StrPrincpal);
                        System.out.println();
                        System.out.print("Enter the rate: ");
                        StrIntRate = dataIn.readLine (); //Places data into the string StrPrincpal
                        IntRate = Double.parseDouble (StrIntRate);
                        System.out.println();
                        System.out.print("Enter the term of the loan: ");
                        StrTerm = dataIn.readLine (); //Places data into the string StrPrincpal
                        term = Integer.parseInt (StrTerm);
                        System.out.println();
                        //Calculation
                        rate = (IntRate / 100.0) / 12.0;     // converts % to decimal format
                        Calpymt = rate + 1;                         // calculate interest
                        term = 30*12;                              // calculate number of years to number of months
                        pymt = princpal * (Math.pow(Calpymt, term) * rate)/ (Math.pow (Calpymt, term) -1);      // formula to calculate monthly payment
                        System.out.println("\nMonthly payment will be: " + moneyFormat.format(pymt) + "\n");  // outputs monthly payment to screen
                        System.out.println("Date of report:" + currentDate);
                       System.out.println("\n");  // create a blank line after output
                       //User response required y or n to refresh the calculator to perform another calculation
                       System.out.println("Do you wish to calculate another mortgage?\n");
                       System.out.print("Please Enter Y or N:\t");
                       System.out.println("\n");
                   option = (char)System.in.read();
                             //StrResponse = dataIn.readLine();
                             //option = Character.parseChar(StrResponse);
                             //}  //close while loop
                   } //close loopI have defind variable as char option;
    Thanks for any assistance you can give me on this issue.

    This is quite common in novice coding. Especially if it's for a uni assignment ;)
    The important thing is that you take the time to understand what the compiler is trying to tell you.
    on line 53, the variable "option" is compared to 'Y'. However, if you have only declared "option":-
    char option;
    as opposed to:-
    char option = OPTION_DEFAULT_VALUE;
    The Java compiler cannot compile the program if "option" might not have been initialised. If "option" isn't initialised, you'll get an exception when you try to enter the while loop.
    Initialise option with a default value before the logic that sets it occurs.
    And try to understand what the compiler is telling you.

  • How to get the last error for while loop?

    How to get the last error for while loop? I just want transfer the last error for while loop, but the program use the shift register shift all error every cycle.

    What do you mean by "get" and "transfer"?
    If the shift register is not what you want, use a plan tunnel instead.
    Typically, programmers are interested in the first, not last, error.
    Can you show us your code so we have a better idea what you are trying to?
    LabVIEW Champion . Do more with less code and in less time .

  • My daq 6008 wil not drop the 5V after the VI is stopped, i have a digital signal going from the error out on the daq in the while loop to the error in on the daq outside the while loop and a boolean going to the data of the daq outside

    my daq 6008 wil not drop the 5V on a digital output after the VI is stopped, i have a digital signal going from the error out on the daq in the while loop to the error in on the daq outside the while loop and a boolean going to the data of the daq outside, but i can t seemto get it to work

    i attached the block diagram so you can have a look
    Attachments:
    PID Temp control.docx ‏120 KB

  • Error in While loop

    Hi,
    I want to write a while loop to compare 2 variables: I tried the below options but no success.
    while [$i -le $ROWS] gives "unary operator expected"
    while [${i} -le ${ROWS}] same error
    while ["$i" -le "$ROWS"] gives "integer expression expected"
    I am using BASH. Please Help.
    Yogini

    Ohhh..it was my mistake. I was redirecting the SQL query output to somewhere else..so ROWS was NULL.
    The code is working now.
    Thanks!
    Yogini

  • Error -50103 occured with timed loop inside a while loop

    Hello everyone,
    i wrote an application to sample analog voltage from  DAQ6024E card (see the attachments).
    I have a big while loop in the VI because a I want to add some other functions later.
    In the "WHILE_Cont Acq&Graph Voltage-Int Clk.vi" I use a while loop inside the big while loop to read the samples. It's working properly.
    but when I use a timed loop inside the big while loop (see "TIMED_LOOP_Cont Acq&Graph Voltage-Int Clk.vi"), I get an error -50103 from the timed loop.  It seems that the first cycle is ok, but after the first cycle the error occurs.
    I don't know what happens with the timed loop, anyone can help me? what does the error -50103 mean? thanks a lot!
    PS: I am using LabVIEW 8.0
    Message Edited by molo511 on 10-22-2006 05:21 AM
    Message Edited by molo511 on 10-22-2006 05:23 AM
    Attachments:
    TIMED_LOOP_Cont Acq&Graph Voltage-Int Clk.vi ‏143 KB
    WHILE_Cont Acq&Graph Voltage-Int Clk.vi ‏75 KB

    hi molo511,
    I tested your program but only with simulated devices. I had to delete the wire to the timing, so that the timed while loop runs with 1kHz. Did you already try this? Because this works on my PC.
    I also found a link in our database that might be interesting for you.
    http://digital.ni.com/public.nsf/websearch/04BEDD9E9E91ED3486256D180048116D?OpenDocument
    Greets
    Philipp N.
    NI Application Engineer

  • While loop brings out of bounds error

    I cannot see why this while loop is bring the out of bounds errror in my program please let me know how to correct it
    thanx
    import java.util.Scanner;
    public class UniqueNumbers
         public int count3 = 0;
         public int count2 = 0;
         public int count = 0;
    public int number = 0;
    // public int ifnumber;
    public int arrayBuild()
         int numbers[]; // declare array named array
         numbers = new int[ 5 ]; // create the space for array
    Scanner input = new Scanner(System.in);
    //System.out.println("Enter a number between 10 and 100.");
    //int ifnumber = input.nextInt();
    while (count3 <=numbers.length)
    System.out.println("Enter a number between 10 and 100.");
    int ifnumber = input.nextInt();
              if (ifnumber >= 10 || ifnumber <= 100)
              numbers[count] = ifnumber;
                   count++;
                   count3++;
    if (ifnumber < 10 || ifnumber > 100)
    System.out.println("Number is out of range.");
              continue;
    //for(count2 = 0; count2 < numbers.length; count2++)
    // if(numbers[count] != ifnumber)
    // System.out.printf("%d\n",ifnumber);
    }//end while loop
    return numbers[count];
    }//end arrayBuild
    public void displayMessage()
         //display number inputted by user
              System.out.printf("The number you entered is: %d \n", getNumbers() );
    }//end displayMessage
    public int getNumbers( )
         number = arrayBuild();
         return number;
    }//end getNumbers
    }

    Do this instead:
    while (count3 <numbers.length)

  • How to use while loops to implement a simple climate control.

    Hi,
    I am currently a 4’th year computer systems engineering student in South Africa doing a primitive climate control project in LabVIEW 8.0. Although my knowledge and skill level of LabVIEW is far from that of an expert, I really enjoy working with it. The project consists of a motor driving some fan blades, a resistor heater and an analog temperature sensor. The basic functionality entails that a user specifies a desired temperature and then the program will heat if the current temperature is lower than desired or cool if the current temperature is above the desired temperature.
    What I want to add is an acceptable temperature difference so that the fan and heater do not switch constantly as the threshold temperature is reached. Rather leave the current temperature to linger between the maximum (current + acceptable difference) or minimum (current – acceptable difference) allowed temperature before heating or cooling it to the desired temperature once again.
    I have attached 2 VI’s:
    Final Assignment: I tried to achieve the sensible climate control by making use of a formula node. As soon as I substituted the if statements in the formula node with while statements, the VI did not respond. It did not give any errors, it just didn’t respond.
    Final Assignment2: I tried the same but by making use of while loop structures. The while where my Input DAQ is works fine, but none of the other while loops work.
    Please advise me on possible solutions for my problem/project.
    Thank you in advance.
    D. Weppenaar
    Attachments:
    Final Assignment1.vi ‏254 KB
    Final Assignment21.vi ‏256 KB

    1. Your VI does not respond because your formula node is trapped in an infinite loop and cannot exit if you're out of the deadband. Replace the words "while" with "if" (or similar) and you might be getting somewhere. Sorry, I don't have DAQ installed, but what determines the loop rate?
    2. You have a dataflow issue. Only the inner loop on the left will run. All other loops must wait because they depend on data from the first loop. data is only available at an output tunnel of a loop once the loop finishes and a loop cannot start until all input tunnels contain data. Also the first loop can never stop, because the stop button is outside the loop and will never get read once the inner loop starts. The stop button needs to be in the innermost loop.
    Most likely, all code segments should run synchronized, so delete all the inner loops. They serve no purpose. All yon need is the big outer loop as in the first code.
    There are many ways to directly observe what is going on. For example you could run the VI in execution highlighting mode while watching the diagram.
    Clearly, you need to become more familiar with LabVIEW basics. Maybe do a tutorial? Right now you might think that dataflow is a hindrance while in fact it is one of the most powerful advantages of dataflow programming. You simply need to be familiar with its logic.
    LabVIEW Champion . Do more with less code and in less time .

  • Help... While Loop

    Help I can't seem to get the loop to function. I need to have the program to ask the user if they want to reuse the calculator and if yes the user input and calculation function will refresh and start over. If no then it should prompt to close. The following is my code which functions fine without the loop.
    // Import Java packages
         import java.text.NumberFormat;
         import java.util.Locale;
         import java.text.DecimalFormat;
         import java.util.Date;
         import java.io.*;
         import static java.lang.Math.*;
         public class Mortgage /* Begin program*/
              public static void main (String [] args) throws IOException     /* Create a class instance*/
                   //Variables
                   String StrPrincpal;          //holds user input for calculation
                   String StrIntRate;
                   String StrTerm;
                   String StrResponse;
                   double principal = 0;      // amount to be financed
                   double IntRate = 0;          // rate of interest to repay the loan
                   double pymt;               // returns the payment amount
                   double rate, Calpymt;     // holds calculated values
                   int term = 0;               // length of loan in years
                   char option;               // holds users text responses (yes or no)
                   Date currentDate = new Date();      // Date constructor
                   NumberFormat moneyFormat = NumberFormat.getCurrencyInstance(Locale.US);  // create US dollar print out format
                   DecimalFormat twoDigits = new DecimalFormat("$0.00");  // formats decimal to 2 place
                   BufferedReader dataIn= new BufferedReader(new InputStreamReader(System.in)); //using for numerical data
                   BufferedReader myIn= new BufferedReader(new InputStreamReader(System.in)); //using for text/string char
                   //Prompt for user input
                   System.out.println("Mortgage Calculator");
                   System.out.println("Date Created: May 28, 2007");
                   System.out.println("Version: 2.0\n");
                   System.out.println("This program will determine the monthly mortgage payment.\n");
                   //While statement to prompt user to continue to use calculator or to quit.
                   while ((option == 'Y') || (option == 'y'))
                   {  //begin loop
                        System.out.print("Enter the amount to be financed: $");
                        StrPrincpal = dataIn.readLine (); //Places data into the string StrPrincpal
                        principal = Double.parseDouble (StrPrincpal);
                        System.out.println();
                        System.out.print("Enter the rate: ");
                        StrIntRate = dataIn.readLine (); //Places data into the string StrPrincpal
                        IntRate = Double.parseDouble (StrIntRate);
                        System.out.println();
                        System.out.print("Enter the term of the loan: ");
                        StrTerm = dataIn.readLine (); //Places data into the string StrPrincpal
                        term = Integer.parseInt (StrTerm);
                        System.out.println();
                        //Calculation
                        rate = (IntRate / 100.0) / 12.0;     // converts % to decimal format
                        Calpymt = rate + 1;                         // calculate interest
                        term = 30*12;                              // calculate number of years to number of months
                        pymt = principal * (Math.pow(Calpymt, term) * rate)/ (Math.pow (Calpymt, term) -1);      // formula to calculate monthly payment
                        System.out.println("\nMonthly payment will be: " + moneyFormat.format(pymt) + "\n");  // outputs monthly payment to screen
                        System.out.println("Date of report:" + currentDate);
                       System.out.println("\n");  // create a blank line after output
                       //User response required y or n to refresh the calculator to perform another calculation
                        System.out.println("Do you wish to calculate another mortgage?\n");
                        System.out.print("Please Enter Y or N:\t");
                        System.out.println("\n");
                        //option = (char) System.in.read();
                             StrResponse = dataIn.readLine();
                             option = Character.parseChar(StrResponse);
                             //}  //close while loop
                   } //close loop
         }//End method
    }     //End ProgramError message: "G:\UOP\POS 406\Java Assignements\Week 3, Assignment 2\MortgageCalcV1.java:91: cannot find symbol
    symbol : method parseChar(java.lang.String)
    location: class java.lang.Character
                             option = Character.parseChar(StrResponse);
                             ^
    1 error
    Tool completed with exit code 1"
    I have no doubt I'm over looking something very simple. If you respond please just don't give me the correction please include what I'm missing or doing wrong.
    Thanks,

    Hi,
    I'm not sure what your exact problem is, it may have something to do with that extra new line character at the end, but that not withstanding, I would do a few things differently.
    1) I would import and utilize the Scanner class, instead of the bufferred reader
    2) I would use strings, and not chars as input from the user, and thus be able to test for "yes" using the StringObj.equalsIgnoreCase("yes"); method, which cuts down on havig to test for "yes", "YES", YeS", etc.
    Here is your code, doing what I believe you expected it would, with the import of the Scanner class (I would swap out all instances of your buffered reader for the scanner class):
    // Import Java packages
    import java.text.NumberFormat;
    import java.util.Locale;
    import java.text.DecimalFormat;
    import java.util.Date;
    import java.io.*;
    import java.util.Scanner;
    import static java.lang.Math.*;
    public class Mortgage /* Begin program*/
         public static void main (String [] args) throws IOException     /* Create a class instance*/
              //Variables
              String StrPrincpal;          //holds user input for calculation
              String StrIntRate;
              String StrTerm;
              String StrResponse;
              double principal = 0;      // amount to be financed
              double IntRate = 0;          // rate of interest to repay the loan
              double pymt;               // returns the payment amount
              double rate, Calpymt;     // holds calculated values
              int term = 0;               // length of loan in years
              String option = "yes";               // holds users text responses (yes or no)
              Date currentDate = new Date();      // Date constructor
              NumberFormat moneyFormat = NumberFormat.getCurrencyInstance(Locale.US);  // create US dollar print out format
              DecimalFormat twoDigits = new DecimalFormat("$0.00");  // formats decimal to 2 place
              BufferedReader dataIn= new BufferedReader(new InputStreamReader(System.in)); //using for numerical data
              BufferedReader myIn= new BufferedReader(new InputStreamReader(System.in)); //using for text/string char
              //Prompt for user input
              System.out.println("Mortgage Calculator");
              System.out.println("Date Created: May 28, 2007");
              System.out.println("Version: 2.0\n");
              System.out.println("This program will determine the monthly mortgage payment.\n");
              //While statement to prompt user to continue to use calculator or to quit.
              while (option.equalsIgnoreCase("yes"))
                   {  //begin loop
                   System.out.print("Enter the amount to be financed: $");
                   StrPrincpal = dataIn.readLine (); //Places data into the string StrPrincpal
                   principal = Double.parseDouble (StrPrincpal);
                   System.out.println();
                   System.out.print("Enter the rate: ");
                   StrIntRate = dataIn.readLine (); //Places data into the string StrPrincpal
                   IntRate = Double.parseDouble (StrIntRate);
                   System.out.println();
                   System.out.print("Enter the term of the loan: ");
                   StrTerm = dataIn.readLine (); //Places data into the string StrPrincpal
                   term = Integer.parseInt (StrTerm);
                   System.out.println();
                   //Calculation
                   rate = (IntRate / 100.0) / 12.0;     // converts % to decimal format
                   Calpymt = rate + 1;                         // calculate interest
                   term = 30*12;                              // calculate number of years to number of months
                   pymt = principal * (Math.pow(Calpymt, term) * rate)/ (Math.pow (Calpymt, term) -1);      // formula to calculate monthly payment
                   System.out.println("\nMonthly payment will be: " + moneyFormat.format(pymt) + "\n");  // outputs monthly payment to screen
                   System.out.println("Date of report:" + currentDate);
                   System.out.println("\n");  // create a blank line after output
                   //User response required y or n to refresh the calculator to perform another calculation
                   System.out.println("Do you wish to calculate another mortgage?\n");
                   System.out.print("Please Enter 'yes' to continue:");
                   Scanner keyboard = new Scanner(System.in);
                   option = keyboard.next();
                   } //close loop
         }//End method
    }

  • Problem with DAQ in while loop and Graphs

    Hello,
    I'm new here so I apologize if I posted this on the wrong board  
    This is my "situation":
    I need to make a simple PID controller which takes information (process variable) from an outside source (a NI's DAC connected through the USB port ) which is accomplished using NI-DAQ as an input, and the PID's output goes to the second NI-DAQ which is also connected using DAC to an actuator which in my case regulates the air pressure. (VI attached)
    My problem is the following.
    Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.
    -If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.
    -If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).
    The timing settings for the DAQ's N samples, 100 samples to read at the rate of 1k (I also tried with Continuous samples and many different combinations of Samples to Read an Rate but without success).
    Should I wire them with the same dt(s)?
    The other thing I need to do (I'm also writing it here in order not to open new topics) is show the following 3 signals on a Graph (process variable (dynamic data type)(range 4mA - 20mA), PID output (double)(range 4mA - 20mA), and the Set Point (double)(range 0 to inf))
    Firstly, is it possible to show the first two on a scale from 0 to 100 without changing the PID's output which needs to be 4-20?
    Secondly, which graph should I use if I have different data types? (I tried the Waveform Chart, and succeeded in showing the first two; the third just messes everything up)
    I would also have to make a legend explaining which signal is which (I see that this is possible with the Mixed Signal Graph).
    I know this is probably too much to ask, but I'd be grateful for any help
    Thank you in advance
    Attachments:
    PID while.vi ‏100 KB

    My problem is the following. Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.
    -If
    I place them in separate loops, I have the problem of passing
    information between the Input NI-DAQ and the PID, and also between the
    PID and the Output NI-DAQ.
    This is the best option---Use QUEUE or Functional global or something else to tranfer the data to and fro
    How  do I make that QUEUE or Functional global?
    -If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).
    Have
    you tried increasing the buffer? Is the acquisition happening
    parallelly (means to say the first DAQ not wired (error terminal) to
    second DAQ)
    Well the buffer is, at least how I understood it, the option Number of Samples when in Continuous Samples mode. Concerning the parallel acquisition, do you mean I should wire the error ports of both of the DAQs?

  • How can I write waveform data from a while loop?

    Alright, I have a NI-5122 high speed digitizer that I need to acquire 10,000 waveforms. I am currently using the NI example code "niScope EX Multi Record Fetch More Than Available Memory.vi" to do this and then onto that later. I set the Number of Records to 10,000, min record length to 8192, and the min sample rate to 100M (S/s). On the Fetch vi,  I set it to get a 1D Dbl array and then send it to the while loop edge for auto indexing. What I want is to take each waveform and write it to a file next to the previous waveform not append it to the bottom of the previous one. I can do 100 and sometimes 1000 waveforms with my current setup and then use "write measurement to file.vi" to save the data, but at 10,000 it says that the memory is full. I have 256 MB on the NI-5122 and 4G of memory on my host computer. My reasoning is that if the NI-5122 can hold all that data then why can't my host computer. I have tried to fetch using 2D Dbl and transpose that matrix and send the data to "write measurement to file.vi" inside the loop and append the data that way, but when I do this the card does not acquire any data. Which seems like a software problem. I know this is probabaly worded poorly, so just post a response if further explanation is needed.
    Thank you.

    Hello,
    It sound like you might have received a LabVIEW: Memory is full message.  Are you also graphing this data as it is being acquired?  Are you building an array inside the loop?  At the 100 MS/s rate, you are using a lot of memory to acquire, graph, build and transpose array data, and then write to file.  If you are saving to file and do not necessary need to see the data, I would suggest taking the graphical indicator out of the code.  Please review some of the KnowledgeBases linked below about the LabVIEW: Memory is full.
    KB 36QD14V3: Why Do I Receive a "Memory is Full, VI Stopped at Loop Tunnel 0xXXXX" Error?
    KB 3ZNDGRS9: LabVIEW "Memory is Full" Error
    Samantha
    National Instruments
    Applications Engineer

  • How can i get the while loop to enter a different loop beside the first one

    I can't seem to figure out how to change the value to enter into one of the other while statements in the script. I am new to this and can't seem to find anything how to enter in the information to be able to go to different while statements and then run
    what is located in that statement.
    The script is supposed to let me choose between TC, MonsterLock, and Cyc and then jump to the while statement that is associated with one of them and then run what ever is located in that block. All i am getting is a infinite loop and it never sees the other
    while loops. I have 3 set up the go along with the first statement but no matter what i type in for them it always looks at the first while statement and stays there.
    Can someone please help me with having it do what i stated earlier.  
    write-host "This script sets up DATABASE Staging"
    $ProductionDistro = Read-Host -Prompt "Which production do you `enter code here`want to run?(TC/MonsterLock/Cyc)"
    While($ProductionDistro -notmatch "(TC|MonsterLock|Cyc)"){
    write-host "You have entered an error" -ForegroundColor Red
    write-host "You must type TC or MonsterLock or Cyc"
    write-host "you typed $ProductionDistro"
    write-host "This script sets up DATABASE Staging"
    $ProductionDistro = Read-Host -Prompt "Which production do you `enter code here`want to run?(TC/MonsterLock/Cyc)"
    while($ProductionDistro -match $TC) {
    write-host "Sets up location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"
    While($ElementDistro -notmatch "(DATABASE1|DATABASE2|DATABASE3|DATABASE4|ALL)") {
    write-host "you have enterd an error" -ForegroundColor Red
    write-host "You must type DATABASE1 or DATABASE2 or DATABASE3 or DATABASE4 or ALL"
    write-host "you typed $ElementDistro"
    write-host "set location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"
    While($PrductionDistro -match $MonsterLock){
    write-host "Sets up location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"
    While($ElementDistro -notmatch "(DATABASE1|DATABASE2|DATABASE3|DATABASE4|ALL)") {
    write-host "you have enterd an error" -ForegroundColor Red
    write-host "You must type DATABASE1 or DATABASE2 or DATABASE3 or DATABASE4 or ALL"
    write-host "you typed $ElementDistro"
    write-host "set location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"
    while( $ElementDistro -match $DATABASE1 ){
    function Execute-MySqlcommand {param( [string]$Server, #the host of the SQL server
    [string]$Database1, #the name of the database
    [System.Data.MySqlclient.MySqlcommand]$Command) #the command to execute (name of stored command)
    $mysqlConnection = new-object System.Data.MySqlclient.MySqlConnection
    $MySqlConnection.ConnectionString = "DROP_VIEW DATABASE.BTXADDR;DROP_VIEW DATABASE.BTXSUPB;CREATE_VIEW DATABASE.BTXADDR FOR DATABASE1.DATABASE1S2.BTXADDR;CREATE_VIEW DATABASE.BTXSUPB FOR DATABASE1.DATABASE1S3.BTXSUPB"
    $MySqlConnection.ConnectionString = "TRUNCATE TABLE DATABASE1.DATABASE1S2.BTXADDR;TRUNCATE TABLE DATABASE1.DATABASE1S3.BTXSUPB; INSERT INTO DATABASE1.DATABASE1S3.BTXSUPB SELECT * FROM DATABASE1.DATABASE1S2.BTXSUPB; select count(*) from DATABASE1.DATABASE.BTXADDR; select count(*) from DATABASE1S.DATABASE.BTXADDR; select count(*) from DATABASE1.DATABASE.BTXSURB; select count(*) from DATABASE1S.DATABASE.BTXSUPB;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $mysqlConnection
    $mysqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $mysqlConnection.Close()
    if ($Result -gt 0) {return $True} else {return $False}
    function Execute-MySQLCommand {param( [string]$Server, #the host name of the SQL server
    [string]$DATABASE1, #the name of the database
    [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $sqlConnection.ConnectionString = "DATABASE_CONNECT_STRING=DSN=DATABASE1;Description=DATABASE1;Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE1;DATASET=DEFAULT"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $sqlConnection
    $sqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $sqlConnection.Close()
    if ($Result -gt 0) {return $TRUE} else {return $FALSE}
    function Copy-File {
    #.Synopsis
    # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists
    param}($DATABASE0980453.pkg,"d/DATABASE1/code_stg")
    # create destination if it's not there ...
    #mkdir $destination -force -erroraction SilentlyContinue
    foreach($original in ls $source -recurse) {
    $result = $original.FullName.Replace($source,$destination)
    while(test-path $result -type leaf){ $result = [IO.Path]::ChangeExtension($result,"copy$([IO.Path]::GetExtension($result))") }
    if($original.PSIsContainer) {
    # mkdir $result -ErrorAction SilentlyContinue
    # } else {
    copy $original.FullName -destination $result
    cd /d/DATABASE1/code_stg
    install ../DATABASE0980453.pkg
    while($ElementDistro -match $DATABASE2 ) {
    function execute-MySqlcommand {param( [string]$Server, #the host of the SQL server
    [string]$DataBase2, #the name of the database
    [System.Data.MySqlclient.MySqlcommand]$Command) #the command to execute (name of stored command)
    $mysqlConnection = new-object System.Data.MySqlclient.MySqlConnection
    $MySqlConnection.ConnectionString = "DROP_VIEW DATABASE.BTXADDR;DROP_VIEW DATABASE.BTXSUPB;CREATE_VIEW DATABASE.BTXADDR FOR DATABASE2.DATABASE2MS2.BTXADDR;CREATE_VIEW DATABASE.BTXSUPB FOR DATABASE2.DATABASE2S3.BTXSUPB"
    $MySqlConnection.ConnectionString = "TRUNCATE TABLE DATABASE2.DATABASE2S2.BTXADDR;TRUNCATE TABLE DATABASE2.DATABASE2S3.BTXSUPB; INSERT INTO DATABASE2.DATABASE2S3.BTXSUPB SELECT * FROM DATABASE2.DATABASE2S2.BTXSUPB; select count(*) from DATABASE2.DATABASE.BTXADDR; select count(*) from DATABASE2S.DATABASE.BTXADDR; select count(*) from DATABASE2.DATABASE.BTXSURB; select count(*) from DATABASE2S.DATABASE.BTXSUPB;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $mysqlConnection
    $mysqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $mysqlConnection.Close()
    if ($Result -gt 0) {return $True} else {return $False}
    function Execute-MySQLCommand {param( [string]$Server, #the host name of the SQL server
    [string]$DATABASE2, #the name of the database
    [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $sqlConnection.ConnectionString = "DATABASE_CONNECT_STRING=DSN=DATABASE2; Description=DATABASE2; Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE2;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $sqlConnection
    $sqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $sqlConnection.Close()
    if ($Result -gt 0) {return $TRUE} else {return $FALSE}
    function Copy-File {
    #.Synopsis
    # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists
    param}($DATABASE0980453.pkg,"d/DATABASE2/code_stg")
    # create destination if it's not there ...
    #mkdir $destination -force -erroraction SilentlyContinue
    foreach($original in ls $source -recurse) {
    $result = $original.FullName.Replace($source,$destination)
    while(test-path $result -type leaf){ $result = [IO.Path]::ChangeExtension($result,"copy$([IO.Path]::GetExtension($result))") }
    if($original.PSIsContainer) {
    # mkdir $result -ErrorAction SilentlyContinue
    # } else {
    copy $original.FullName -destination $result
    cd /d/DATABASE2/code_stg
    install ../DATABASE0980453.pkg
    While( $ElementDistro -match $DATABASE3 ) {
    function Execute-MySqlcommand {param( [string]$Server, #the host of the SQL server
    [string]$DATABASE3, #the name of the database
    [System.Data.MySqlclient.MySqlcommand]$Command) #the command to execute (name of stored command)
    $mysqlConnection = new-object System.Data.MySqlclient.MySqlConnection
    $MySqlConnection.ConnectionString = "DROP_VIEW DATABASE.BTXADDR;DROP_VIEW DATABASE.BTXSUPB;CREATE_VIEW DATABASE.BTXADDR FOR DATABASE3.DATABASE3S2.BTXADDR;CREATE_VIEW DATABASE.BTXSUPB FOR DATABASE3.DATABASE3S3.BTXSUPB"
    $MySqlConnection.ConnectionString = "TRUNCATE TABLE DATABASE3.DATABASE3S2.BTXADDR;TRUNCATE TABLE DATABASE3.DATABASE3S3.BTXSUPB; INSERT INTO DATABASE3.DATABASE3S3.BTXSUPB SELECT * FROM DATABASE3.DATABASE3S2.BTXSUPB; select count(*) from DATABASE3.DATABASE.BTXADDR; select count(*) from DATABASE3S.DATABASE.BTXADDR; select count(*) from DATABASE3.DATABASE.BTXSURB; select count(*) from DATABASE3S.DATABASE.BTXSUPB;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $mysqlConnection
    $mysqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $mysqlConnection.Close()
    if ($Result -gt 0) {return $True} else {return $False}
    function Execute-MySQLCommand {param( [string]$Server, #the host name of the SQL server
    [string]$DATABASE3, #the name of the database
    [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $sqlConnection.ConnectionString = "DATABASE_CONNECT_STRING=DSN=DATABASE3;Description=DATABASE3;Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE3;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $sqlConnection
    $sqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $sqlConnection.Close()
    if ($Result -gt 0) {return $TRUE} else {return $FALSE}
    cd /d/DATABASE3/code_stg
    install ../DATABASE0980453.pkg
    function Copy-File {
    #.Synopsis
    # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists
    param}($DATABASE0980453.pkg,"d/DATABASE3/code_stg")
    # create destination if it's not there ...
    #mkdir $destination -force -erroraction SilentlyContinue
    foreach($original in ls $source -recurse) {
    $result = $original.FullName.Replace($source,$destination)
    while(test-path $result -type leaf){ $result = [IO.Path]::ChangeExtension($result,"copy$([IO.Path]::GetExtension($result))") }
    if($original.PSIsContainer) {
    # mkdir $result -ErrorAction SilentlyContinue
    # } else {
    copy $original.FullName -destination $result
    While($ElementDistro -match $DATABASE4 ) {
    function Execute-MySqlcommand {param( [string]$Server, #the host of the SQL server
    [string]$DATABASE4, #the name of the database
    [System.Data.MySqlclient.MySqlcommand]$Command) #the command to execute (name of stored command)
    $mysqlConnection = new-object System.Data.MySqlclient.MySqlConnection
    $MySqlConnection.ConnectionString = "DROP_VIEW DATABASE.BTXADDR;DROP_VIEW DATABASE.BTXSUPB;CREATE_VIEW DATABASE.BTXADDR FOR DATABASE4.DATABASE42.BTXADDR;CREATE_VIEW DATABASE.BTXSUPB FOR DATABASE4.DATABASE4S3.BTXSUPB"
    $MySqlConnection.ConnectionString = "TRUNCATE TABLE DATABASE4.DATABASE4S2.BTXADDR;TRUNCATE TABLE DATABASE4.DATABASE4S3.BTXSUPB; INSERT INTO DATABASE4.DATABASE4S3.BTXSUPB SELECT * FROM DATABASE4.DATABASE4S2.BTXSUPB; select count(*) from DATABASE4.DATABASE.BTXADDR; select count(*) from DATABASE4S.DATABASE.BTXADDR; select count(*) from DATABASE4.DATABASE.BTXSURB; select count(*) from DATABASE4S.DATABASE.BTXSUPB;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $mysqlConnection
    $mysqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $mysqlConnection.Close()
    if ($Result -gt 0) {return $True} else {return $False}
    function Execute-MySQLCommand {param( [string]$Server, #the host name of the SQL server
    [string]$DATABASE4, #the name of the database
    [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $sqlConnection.ConnectionString = "DATABASE_CONNECT_STRING=DSN=DATABASE4;Description=DATABASE4;Trusted_Connection=Yes;WSID=Server;DATABASE=TF90PVS;"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $sqlConnection
    $sqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $sqlConnection.Close()
    if ($Result -gt 0) {return $TRUE} else {return $FALSE}
    function Copy-File {
    #.Synopsis
    # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists
    param}($DATABASE0980453.pkg,,"d/DATABASE4/code_stg")
    # create destination if it's not there ...
    #mkdir $destination -force -erroraction SilentlyContinue
    foreach($original in ls $source -recurse) {
    $result = $original.FullName.Replace($source,$destination)
    while(test-path $result -type leaf){ $result = [IO.Path]::ChangeExtension($result,"copy$([IO.Path]::GetExtension($result))") }
    if($original.PSIsContainer) {
    # mkdir $result -ErrorAction SilentlyContinue
    # } else {
    copy $original.FullName -destination $result
    cd /d/DATABASE4/code_st
    install ../DATABASE0980453.pkg
    While($ElementDistro -match $ALL ){
    function Execute-MySQLCommand {param( [string]$Server, #the host name of the SQL server
    [string]$DATABASE1,$DATABASE2,$DATABASE3,$DATABASE4, #the name of the database
    [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $sqlConnection.ConnectionString = "(DATABASE_CONNECT_STRING=DSN=DATABASE1;Description=DATABASE1;Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE1;DATASET=DEFAULT;),(DATABASE_CONNECT_STRING=DSN=DATABASE2; Description=DATABASE2; Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE2;),(DATABASE_CONNECT_STRING=DSN=DATABASE3;Description=DATABASE3;Trusted_Connection=Yes;WSID=Server;DATABASE=DATABASE3;),(DATABASE_CONNECT_STRING=DSN=DATABASE4;Description=DATABASE4;Trusted_Connection=Yes;WSID=Server;DATABASE=TF90PVS;)"
    $Command.CommandType = 1 # 1 is the 'Text' command type
    $Command.Connection = $sqlConnection
    $sqlConnection.Open()
    $Result = $Command.ExecuteNonQuery()
    $sqlConnection.Close()
    if ($Result -gt 0) {return $TRUE} else {return $FALSE}
    install ../DATABASE0980453.pkg
    While($ProductionDistro -match $Cyc) {
    write-host "Sets up location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"
    While($ElementDistro -notmatch "(DATABASE1|DATABASE2|DATABASE3|DATABASE4|ALL)") {
    write-host "you have enterd an error" -ForgroundColor Red
    write-host "You must type DATABASE1 or DATABASE2 or DATABASE3 or DATABASE4 or ALL"
    write-host "you typed $ElementDistro"
    write-host "set location you want to run staging"
    $ElementDistro = Read-Host -Prompt "Which Element do you want to run? (DATABASE1/DATABASE2/DATABASE3/DATABASE4/ALL)"

    OK, so you've got a reasonable input loop early on:
    write-host "This script sets up DATABASE Staging"
    $ProductionDistro = Read-Host -Prompt "Which production do you `enter code here`want to run?(TC/MonsterLock/Cyc)"
    While($ProductionDistro -notmatch "^(TC|MonsterLock|Cyc)$"){
    write-host "You have entered an error" -ForegroundColor Red
    write-host "You must type TC or MonsterLock or Cyc"
    write-host "you typed $ProductionDistro"
    write-host "This script sets up DATABASE Staging"
    $ProductionDistro = Read-Host -Prompt "Which production do you `enter code here`want to run?(TC/MonsterLock/Cyc)"
    I've only added two things to that code:  a ^ and $ at the beginning and end of your regex pattern.  As originally written, it would have successfully matched any string containing TC, MonsterLock or Cyc (such as "bogusTCwhatever", etc).
    Now, instead of a bunch of extra While loops based on $ProductionDistro, what you need is some conditionals (either a Switch statement, or some If/ElseIf).  For example:
    switch ($ProductionDistro)
    'TC'
    # Do TC Stuff
    break
    'MonsterLock'
    # Do MonsterLock Stuff
    break
    'Cyc'
    # Do Cyc stuff
    break

  • How to code a parallel 'for loop' and 'while loop' where the while loop cannot terminate until the for loop has finished?? (queues also present)

    I've attached a sample VI that I just cannot figure out how to get working the way that I want.  I've labeled the some sections with black-on-yellow text boxes for clarity during the description that follows in the next few sentences.  Here's what I want:
    1) overall -- i'm intend for this to be a subVI that will do data acquisition and write the data to a file.  I want it to use a producer/consumer approach.  The producer construct is the 'parallel for loop' that runs an exact number of times depending on user input (which will come from the mainVI that is not included).  For now I've wired a 1-D array w/ 2 elements as a test case.  During the producer loop, the data is acquired and put into a queue to be delt with in the consumer loop (for now, i just add a random number to the queue).
    2) the consumer construct is the 'parallel while loop'.  It will dequeue elements and write them to a file.  I want this to keep running continuously and parallel until two conditions are met.
          i. the for loop has finished execution
          ii. the queue is empty.
       when the conditions are met, the while loop will exit, close the queue, and the subVI will finish. (and return stuff to mainVI that i can deal with on my own)
    Here's the problems.
    1)  in the "parallel for loop" I have a flat sequence structure.. I haven't had time to incorporate some data dependency into these two sequential sections, but basically, I just care that the "inner while loop" condition is met before the data is collected and queued.  I think I can do this on my own, but if you have suggestions, I'm interested.
    2)  I can easily get the outer for and while loops to run sequentially, but I want them to run in parallel.  My reasoning for this is that that I anticipate the two tasks taking very different amounts of time. .. basically, I want the while loop to just keep polling the queue to get everything out of it (or I suppose I could somehow use notifiers - suggestions welcome)...  the thing is, this loop will probably run faster than the for loop, so just checking to see that the queue is empty will not work... I need to meet the additional condition that nothing else will be placed in the queue - and this condition is met when the for loop is complete. basically, I just can't figure out how to do this.
    3) for now, I've placed a simple stop button in the 'parallel while loop', but I must be missing something fundamental here, because the stop button is totally unresponsive.  i.e. - when I press it, it stays depressed, and nothing happens.
    suggestions are totally welcome!
    thanks,
    -Z
    Attachments:
    daq01v1.vi ‏59 KB

    I'd actually like to add a little more, since I thought about it a bit and I'm still not quite certain I understand the sequence of events...
    altenbach wrote:
    zskillz wrote:
    So i read a bit more about the 'dequeue element' function, and as I understand it, since there is no timeout wired to the dequeue element function, it will wait forever, thus the race condition I suggested above can never happen!
    Yes, you got it!
    As I've thought about it a bit more, there's a few things that surprise me... first, the reason the 'dequeue element while loop' errors is not because there's nothing in the queue, it's becaues the queue has been released and it's trying to access that released queue...   However the problem I have is this --- Even though there's no timeout wired to the dequeue element, I still would think that the while loop that contains it would continue to run at whatever pace it wanted -- and as i said before.. most of the time, it would find that there is nothing to dequeue, but once in a while, something is there.  however, it seems that this loop only runs when something has been enqueued.  the reason I say this is illustrated in the next code sample MODv2 that's attached below.  I've added a stop button to the "queue size while loop" so the program runs until that is pressed.  I've also added a simple conditional in the "dequeue while loop"  that generates a random number if it a button is pressed... but this button is totally non-responsive... which means to me that the "dequeue while loop" isn't actually continuously running, but only when an element is added to the queue.  this still seems almost like the 'dequeue while loop" waits for a notifier from the queue telling it to run.  can you explain this to me? because it is different from what I expect to be happening.
    rasputin wrote:
    I tried to open your VIs but it doesn't work. LV
    is launched, the dialog box (new, open, configure...) opens and then...
    nothing. Not even an error message. I guess it isn't a problem of LV
    version or a dialog box would appear saying this. Could you, please,
    send a image of the code?
    Thanks,
    Hi Rasputin, I'm using LV8.  I assume that was your problem, but who knows.  I've attached a pic of of altenbach's solution since it's what I needed.
    thanks
    -Z
    Message Edited by zskillz on 10-20-2006 11:49 AM
    Attachments:
    daq01v1MODv2.vi ‏63 KB
    daq01v1MODpic.JPG ‏116 KB

  • How can I build a table with the time values of a timer from a while loop

    Hi:
    I have a question concerning building a table:
    Every 100ms I read a value from a sensor (while loop with a timer). I would like to build a table with the actual time and the concerning value. For example:
    0msec         1V
    100msec     2V
    200msec     3V
    300msec     4V
    etc.
    If I use the Express VI for building a table, I always get the date and time, but I don't need the date and the time is in the following format: HH:MMS, which is nonsensical for me as I can't differentiate within msec. Can I change the format anywhere?
    Can I also save the table to a file or even to an Excelsheet? How can I do that?
    Thanks for your help!

    Hi Craig:
    thank you very much. To solve the mystery : ) :
    I want to drive a stepper motor with a specific frequency. To get the current degree value of the motor I would like to measure the current time (from the beginning of the move on). (With a formula I get the degree value out of the time)
    Concurrently I would like to get data from a torque sensor and from a pressure sensor. That's why I asked you about the time and the table. The measurement should start with the movement of the motor. How can I do that? Right now I have different block diagrams (different while loops) (see attachment) and I would like to put them in one.
    I haven't done the block diagram for the pressure sensor yet, so there is only the one for the torque sensor and the one for the motor.
    I also would like to set a mark in the table when the voltage value of an analog input gets under a specific threshold value. Is that possible?
    I'm sorry, I'm a novice in LabVIEW. But maybe you can help me.
    Thank you very much!
    Steffi
    Attachments:
    motor.vi ‏238 KB
    sensor.vi ‏59 KB

  • AI Read is executing only once in a while loop instead of continuously scanning the channels

    The ultimate goal is to sample 15 channels (1 at 20kHz, 9 at 1000Hz, and 5 at 100Hz). Since only one scan rate is possible, I would like to reduce the data (for both displaying and saving purposes). The decimate function does not seem to work correctly.
    Attached is the current subroutine used to 'decimate' the data. It seems to work on the first loop iteration, as seen by the data block with correct time stamps and data values, but with each additional iteration, all values are zero. Why is only one scan being used in the displaying of data?
    Attachments:
    Acquire_N_ScansNM4.llb ‏76 KB

    When you call AI Clear, the DAQ session is over. You will not get any new data by calling AI Read after an AI Clear. Move your AI Clear to the right of your while loop such that it runs after the while loop completes. Don't forget to wire an error cluster or DAQ session ID to AI Clear from inside the while loop to create the data dependency. Also, consider adding a shift register for the error cluster and some way to exit the loop on an error.
    Remember that Alliance Members are here to help. We do this stuff every day.
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

Maybe you are looking for

  • Want to send a email with images and text in the body of email in iOS

    In iOS, we have written a code to send an email,  with embedded images and text in the body of the email ( not attachment) using mail composer. It works well with iOS devices like iPhone and iPad, but does not work in window based OS. Can anybody hel

  • Query in Deleting the Signature using Acrobat 9.0

    Hello Folks, We have used resetForm() method before removefield() in our coding Observed result:   Our application uses VC++,If the document has one Digital Signature using the fix(Mentioned below) we can able to delete the signature in the document 

  • Generation Question!

    Could someone please help me figure out which generation my Ipod mini is? I got it last christmas and have no clue what generation it is.

  • OVI chat unavailable

    I have tried to chat using the application installed in my E5-00, but since the first day I got the message "Temporal service problem. Retry later (Code920)", and it's the same with Ovi chat, MSN, Yahoo, and Google. I erased the app and reinstaled ag

  • When I try to download OS X Lion my Macbook says that I need at least 2 GB of memory even though I already have it

    My MacBook says I have 17.41 GB available but the Mac App Store will not let me dowload OS X Lion. It says "We could not complete your purchase. Mac OS X 10.7 requires at least 2 GB of memory." What does this mean? This is confusing me.