Need help regarding passing values!

Hi All,
I have a page in an application (Multiuser). My Page Region consists of rows selected out of a sql query and with each row selector (radio button). I need the value selected in a forthcoming page. How can i accomplish this effectively.
Should i try inserting the selected value into a temporary table and then select from the same.
Or whether should i pass as a parameter (how to do this)?
Please comment on this.
Thanks & Regards

The easy answer is to store the data in a file, load it at the beginning of the code and also reload it when ever the sensor is changed.  You should encapsulate this in 2 functional sub vi - load config and store config.  The load event will take a serial number and return values for all settings, and the save takes the serial number and settings and a location on where to store the information, and returns an error cluster is it fails.  The tricky part is how and where to store this information.  The most popular methods (there are a few threads on this) are ascii text files, xml, .ini files and inside a database.  The tradeoffs are difficulty or programming vs flexibility.  Speed and space requirements are usually no longer a bottleneck in a task like this.
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Similar Messages

  • Need Help Regarding Enabling The Matrix

    Hi All,
    We have got one user form and we have got one choose from list and one matrix, on click of choose from list the value will be displayed in the text box and at the same time matrix should get enabled. But it;s not happening in our case. The value is coming in the text box through choose from list but matrix is not getting enabled. We are able to change the back ground color of the matrix, make first column invisible and all but not able to enable the matrix. We need help regarding this one.
    Regards,
    Jayanth

    Hey first bind the columns of matrix to any user datasource
    and then you can enter any thing into your matrix 
    following code may help
    suppose you have one column
    oForm = SBO_Application.Forms.Item("URFRM")
    oUserDataSource = oForm.DataSources.UserDataSources.Add("URDSName",
    SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20)
    oMatrix=oForm.Item("URMATRX")
    oMatrix = oItem.Specific
    oColumns = oMatrix.Columns
    oColumn = oColumns.Item("URCOLName")
    oColumn.DataBind.SetBound(True, "", "URDSName")
    oMatrix.Addrow()
    hope this will help
    additionally you can look at this sample
    .....SAP\SAP Business One SDK\Samples\COM UI\VB.NET\06.MatrixAndDataSources

  • Need Help regarding text Output

    Dear gurus.
    I need help regarding formatting of a text.
    I want to format a employee sub group text.
    im getting a text workers (7) from a table t503t having field ptext.
    i want to show only (7) in the output not the whole text how can i do this ?
    Please help
    regards
    Saad.Nisar

    DATA: BEGIN OF itab_odoe OCCURS 0,
      department_text LIKE t527x-orgtx,"Holds the short text for department
      department_no LIKE pernr-orgeh,
      pernr LIKE pernr-pernr,
      ename LIKE pernr-ename,
      grade like t503t-ptext,   "THIS AREA GET ME TEXT OF EMPLOYEE SUBGROUP"
    *  department_text LIKE t527x-orgtx,"Holds the short text for department
      current_year LIKE sy-datum,
      wt0001 LIKE q0008-betrg,"Basic Pay
      wt1101 LIKE q0008-betrg," COLA
      wt3002 LIKE p0015-betrg,"Overtime
      per_basic type p DECIMALS 2,"Overtime percentage on basic
      per_basic_sum type p decimals 2,"Overtime Sum Division
      overtime_sum LIKE p0015-betrg,"holds sum of overtime
      basic_sum like q0008-betrg,"holds sum of basic
    END OF itab_odoe.
    Im using the select statement to get the employee subgroup from the table
    select single ptext
        from t503t
        into itab_odoe-grade
        where persk eq pernr-persk
        AND SPRSL eq 'EN'.
    now in itab_odoe-grade the values comes is Workers (7) , Snr Mgt (M3)
    i want to show only the text in Brackets.

  • Need HELP regarding installinfg CR2008/Visual Advantage

    I need help regarding installing CR2008/Visual Advantage. I had the evaluation copy of cr2008. My compnay purchased the CR2008 Visual Advantage. Upon calling your customer service, I was told that I had to UN-install the CR2008 evaluation copy then install the CR2008. I did the unstall HOWEVER, when I try to install the CR2008 that we purchased, i get the following error..HR
    HR -2147024770-"c:\program files\business objects enterprise 12.0\win32_x86\REPORTCONVTOOL.DLL FAILED TO REGISTER"..
    I get more that just that one...I have received this before and based upon this formum, i have delted the regristry in the following using regedit.exe
    HKEY_LOCAL_MACHINE\SOFTWARE\BUSINESS OBJECT ;
    HKEY_CURRENT_USER\SOFTWARE\BUSINESS OBJECTS..
    Afeter i deleted the keys, I re-boot my pc and try to install the coftware again...BUT I GET THE SAME ERRORS...I have tryied this several times....what am i missing/not doing correctly

    Hi Shamish
    Actually you were on the right track, i think you just have to increase PSAPTEMP a bit and you will be fine. 358 MB seems just too small, i suggest you increase it to at least 2GB.
    1. what will be the difference in use of PSAPUNDO and PSAPTEMP while copy is running. ( i.e. what will be entered in PSAPUNDO and what will be filled in PSAPTEMP.)
    PSAPTEMP: is needed for large sort operations, as mentioned when you have a select with an ORDER BY clause, or if you do join two tables. During the client copy some sorting might be needed for special tables (cluster tables) where data is stored sorted.
    PSAPUNDO: undo space is only needed for DML (data manipulation), if data is changed undo is generated. This obviously is heavily the case during a client copy.
    2. the target client already has a copy taken 1 month before. so I think while importing it first delete existing data and then copies the new one.
    So If I first delete the target client and then take import on it; will it have advantage in regards of getiing UNDO or TEMP segments getting filled ?
    Deleting the client first might help for the undo problem, but you already solved that. I cannot imagine, it will help for the PSAPTEMP issue. As i said i would just increase PSAPTEMP and restart the copy.
    One more add: if you are doing the client copy with parallel processes, this will influence your requirements on temp and undo space, because of the concurrently running processes.
    Best regards
    Michael

  • Need Help Regarding JAVA BEAN

    Is any one tell me that JAVA BEAN only used in WEB or also you in Desktop applications???? and aslo tell how i implement Java class and use JAVA BEAN. I need help regarding above matter
    thanks in advance
    Rehan MIrza

    Here is a good link that indicate that JavaBean is not only for applets
    http://java.sun.com/docs/books/tutorial/javabeans/whatis/beanDefinition.html
    quote:
    The JavaBeans API makes it possible to write component software in the Java programming language. Components are self-contained, reusable software units that can be visually composed into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as Beans.
    Francois

  • I need help regarding setting my mail accounts on macbook pro

    I need help regarding resetting my mail accounts on macbook pro

    What kind of accounts do you need to reset? IMAP or POP accounts using one of the many web-based messaging systems? An Exchange server account? Were they working and now just not working any longer?
    You're going to have to be a little more specific in what you need...
    Clinton

  • I need help regarding installation of Netweaver 2004s

    Hi,
    I need help regarding installation of Netweaver. When ever i am running setup.exe, i am getting a page asking for local host and port number as 21212. When I enter my local host name and the port number as 21200 i am getting the error message given below and the installation stops. I am not able to proceed further. can any one help me what i need to do here. I created MS lookupadapter and entered my static ip address in 'host' file after 127.0.0.1 localhost and i disabled port number 3201 in system file. I verified system variables also. Everything is fine. I dont have firewall or antivirus installed in my system. Is there any thing else i need to do. please help me. Thanks in advance.
    " SAPinst is getting started.
    Please be patient ...
    starting gui server process:
      sapinstport: 21200
      guiport    : 21212
      guistart   : true
      command    : "C:\j2sdk1.4.2_09/bin\javaw.exe" -cp "C:/DOCUME1/ADMINI1/LOCALS1/Temp/sapinst_exe.6496.1162659801\jar\instgui.jar;C:/DOCUME1/ADMINI1/LOCALS1/Temp/sapinst_exe.6496.1162659801\jar\inqmyxml.jar" -Xmx256M -Dsun.java2d.noddraw=true SDTServer config=jar:sdtserver.xml guiport=21212 sapinsthost=localhost sapinstport=21200 guistart=true
    load resource pool G:\SAP\Softwares\IDES mySAP2005\51031898\IM_WINDOWS_I386\resourcepool.xml
    guiengine: no GUI connected; waiting for a connection on host (local hostname) , port 21200 to continue with the installation
    guiengine: login in process...............................
    guiengine: login timeout; the client was unable to establish a valid connection
    Exit status of child: 1"
    Regards,
    Farooq Shaik.

    Hi
    Run the sapinst.exe with the port 21212.This port 21212 is the default port used during the installation of netweaver.

  • I need help regarding measurement of "time domain parameters of Heart rate variability" using labview.

    I need help regarding measurement of "time domain parameters of Heart rate variability" using labview.
    I am using Labview 8 ... I  need to develop a software to accquire the ECG data (simulated enironment ) and compute the time domain parameters of Heart rate variability like "SDNN, SDANN...etc". Can some 1 plllzzzz help me out.Plzz help me if u can.Thanx in advance.

    Hi Andy,
      Thanx for responding.  The input is from a text file. SDNN, SDANN,etc are  the timedomain parameters of heart rate variability.
     SDNN: the standard deviation of the NN or RR interval  i.e. the square root of variance.
    SDANN:the standard deviation of the averageNN interval calculated over short periods, usually 5 min,which is an estimate of the changes in heart rate due tocycles longer than 5 min
    SDNN index, the meanof the 5-min standard deviation of the NN intervalcalculated over 24 h,
     RMSSD: the square root ofthe mean squared differences of successive NN intervals
    NN50: the number of interval differences of successiveNN intervals greater than 50 ms, and
    pNN50 the proportionderived by dividing NN50 by the total numberof NN intervals.
    The problem is dat I am a fresher to the world of Labview. I have jus recently started working on it. Can u please suggest me some some idea as soon as possible.
      As i said  I have the ECG data in the form of text files..I need to create sort of GUI to calculate the time domain parmeters....I need help urgently. Plzzz help me if u can. If u have and .vi example to calculate the RR interval plzz send it to me ASAP.
    Thanku

  • Need Help Regarding  ibook

    em user of   iphone  3gs  os 6.1.6
    Yesterday  i restore ma  iphone
    after that  em  Unable  to   install    ibook in  ma iphone  its  say me that u  need  os 7 ...
    need help regarding this issue....   what i do  is there any alternative app  ...?

    Hey Seungly,
    I've realized that my computer runs fine UNLESS I turn the AirPort on to connect to the Internet. The moment I click "Turn AirPort On," the "You need to restart your computer" screen immediately pops up. Is there any connection between AirPort and my problem?
    That could very easily be the case, a bad Airport card. Look at this recent post:
    http://discussions.apple.com/thread.jspa?messageID=7960754&#7960754
    John diagnosed it from the panic log.
    Does yours say something similar?
    Richard

  • Need help regarding image scanning from scanner and resizing it...

    Hi,
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!
    Thanks,
    Avinash.
    Edited by: Kalakonda on Jul 24, 2009 8:08 AM

    Kalakonda wrote:
    I need help regarding scanning of image directly from scanner. Here is the scenario when the person clicks scan button on the webpage should scan the image and resize it and store it in some temp location. Is there any way i can do this. Any Help regarding this would be great!!!So what you are doing is you have a Scanner (hardware: like an HP flatbed scanner) attached to a server that you want to use as a scanning station? Is this the senario that you are talking about?

  • Need help regarding may ipad, i cant access my ipad, need help regarding may ipad, i cant access my ipad

    need help regarding may ipad, i cant access my ipad, need help regarding may ipad, i cant access my ipad

    Can you be little more specific?

  • Hey guys need help regarding iTunes U. My school is moving for iOS and Mac in the classroom and I have been appointed Junior Administrator for the schools technical department and integrating these devices into the classroom.

    Hey guys need help regarding iTunes U. My school is moving for iOS and Mac in the classroom and I have been appointed Junior Administrator for the schools technical department and integrating these devices into the classroom.
    I have an appointment with a director on Tuesday. I want to demo iTunes U. Problem is I have never used it before and have no idea how to set it up and even if I should sign up.
    Please help any ideas regarding iTunes U and how I should direct the meeting tomorrow.
    Please please post here.
    Thanks
    Tiaan

    Greetings fcit@!A,
    After reviewing your post, it sounds like you are not able to select none as your payment type. I would recommend that you read this article, it may be able to help the issue.
    Why can’t I select None when I edit my Apple ID payment information? - Apple Support
    Thanks for using Apple Support Communities.
    Take care,
    Mario

  • Help in passing value to next .asp page

    Hi all, i need help on this problem. i want to pass the value of tag_num and platform to the detail.asp, somehow it give me error. below are my code and screenshot.
    <%
    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
    %>
          <tr>
            <td height="50" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("tag_num").Value)%></span></td>
            <td height="50" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("platform").Value)%></span></td>
            <td width="205" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("system").Value)%></span></td>
            <td width="41" bgcolor="#FFFFFF"><a HREF="detail.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "tag_num=" & Recordset1.Fields.Item("tag_num").Value & "platform=" & Recordset1.Fields.Item("platform").Value %>">VIEW</a></td>
          </tr>
          <%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      Recordset1.MoveNext()
    Wend
    %>
    "part of detail.asp code to receive the value"
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Request.QueryString("tag_num") <> "") Then
      Recordset1__MMColParam = Request.QueryString("tag_num")
    End If
    %>
    <%
    Dim Recordset1__MMColParam2
    Recordset1__MMColParam2 = "1"
    If (Request.QueryString("platform") <> "") Then
      Recordset1__MMColParam2 = Request.QueryString("platform")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_cmd
    Dim Recordset1_numRows
    Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
    Recordset1_cmd.ActiveConnection = MM_InstrumentDB_STRING
    Recordset1_cmd.CommandText = "SELECT * FROM Instrument_baram WHERE tag_num = ? AND platform = ?"
    Recordset1_cmd.Prepared = true
    Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 200, 1, 255, Recordset1__MMColParam) ' adVarChar
    Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param2", 200, 1, 255, Recordset1__MMColParam2)
    Set Recordset1 = Recordset1_cmd.Execute
    Recordset1_numRows = 0
    %>
    to display the dable, this is my code
    <table width="450" border="1" cellspacing="0" bordercolor="#FF6600" bgcolor="#1941A5">
          <tr>
          <th style="background-color:#CEC49D" height="35" scope="row"><span class="style2">TAG NUMBER</span></th>
            <td bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("tag_num").Value)%></span></td>
        </tr>
          <tr>
          <th style="background-color:#CEC49D" width="200" height="35" scope="row"><span class="style2">PLATFORM</span></th>
          <td width="356" bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("platform").Value)%></span></td>
        </tr>
        <tr>
          <th style="background-color:#CEC49D" height="35" scope="row"><span class="style2">TYPE OF SYSTEM</span></th>
          <td bgcolor="#FFFFFF"><span class="style2"><%=(Recordset1.Fields.Item("system").Value)%></span></td>
        </tr>
    it give me this error
    Please somebody help me. Thanks in advance.
    Regards,
    Zuma.

    yup. my page connected to the server. if i pass "tag_num" value only, it will give me no error. the output is there. but the things is i need to pass "platform" value.
    sample of my database structure is
    Instrument_baram
    tag_num platform field system
    AGSC_503
    BNP-C
    BARONIA
    PMCS
    AGSC_503
    BNP-B
    BARONIA
    PMCS
    TAG NUMBER
    TYPE OF INSTRUMENT
    SYSTEM
    PLATFORM
    AGSC_503
    Limit switch
    PMCS
    BNP-C
    View
    AGSC_503
    Limit switch
    PMCS
    BNP-B
    View
    if i pass "tag_num" value only, it will select AGSC_503 platform BNP-C only eventhough i click on AGSC_503 platform BNP-B "View".
    that why i need to pass the "platform" value

  • Need help regarding Linked List

    I'm a beginner who just spent ages working on the following code.. but need help on re-implementing the following using a linked list, i.e. no array is allowed for customer records but you still can use arrays for names, address, etc.. Hopefully I've inserted enough comments..
    Help very much appreciated!! Thanks! =]
    import java.util.Scanner;
    import java.io.*;
    public class Bank
    /* Private variables declared so that the data is only accessible to its own
         class, but not to any other class, thus preventing other classes from
         referring to the data directly */
    private static Customer[] customerList = new Customer[30];               
         //Array of 30 objects created for storing information of each customer
    private static int noOfCustomers;                                                       
         //Integer used to store number of customers in customerList
         public static void main(String[] args)
              Scanner sc = new Scanner(System.in);
              menu();
         public static void menu()
              char choice;
              String filename;
              int custId,counter=0;
              double interestRate;
    Scanner sc = new Scanner(System.in);
              do
              //Displaying of Program Menu for user to choose
         System.out.println("ABC Bank Customer Management System Menu");     
         System.out.println("========================================");
         System.out.println("(1) Input Data from File");
         System.out.println("(2) Display Data");
         System.out.println("(3) Output Data to File");
                   System.out.println("(4) Delete Record");
                   System.out.println("(5) Update Record");
         System.out.println("(Q) Quit");
                   System.out.println();
                   System.out.print("Enter your choice: ");
                   String input = sc.next();
                   System.out.println();
                   choice = input.charAt(0);     
              //switch statement used to assign each 'selection' to its 'operation'               
         switch(choice)
         case '1': int noOfRecords;
                                       System.out.print("Enter file name: ");
              sc.nextLine();                                             
              filename = sc.nextLine();
                                       System.out.println();
              noOfRecords = readFile(filename);
    System.out.println(+noOfRecords+" records read.");
              break;
         case '2': displayRecords();
              break;
         case '3': writeFile();
         break;
                        case '4': System.out.print("Enter account ID to be deleted: ");
                                       sc.nextLine();
                                       custId = sc.nextInt();
                                       deleteRecord(custId);
                                       break;
                        case '5': if(counter==0)
              System.out.print("Enter current interest rate for saving account: ");
                                            sc.nextLine();
                                            interestRate = sc.nextDouble();
                                            update(interestRate);
                                            counter++;
                                       else
              System.out.println("Error: Accounts have been updated for the month.");
                                            break;
                   }System.out.println();
         }while(choice!='Q' && choice!='q');
    /* The method readFile() loads the customer list of a Bank from a specified
         text file fileName into customerList to be stored as array of Customer
         objects in customerList in ascending alphabetical order according to the
         customer names */
    public static int readFile(String fileName)
         int custId,i=0;
              String custName,custAddress,custBirthdate,custPhone,custAccType;
              double custBalance,curRate;
              boolean d;
    /* Try block to enclose statements that might throw an exception, followed by
         the catch block to handle the exception */
    try
                   Scanner sc = new Scanner(new File(fileName));
    while(sc.hasNext())          
    /* sc.next() gets rid of "Account", "Id" and "=" */
    sc.next();sc.next();sc.next();
    custId = sc.nextInt();
                        d=checkDuplicate(custId);               
    /* checkDuplicate() is a method created to locate duplicating ids in array */
    if(d==true)
    /* A return value of true indicates duplicating record and the sc.nextLine()
         will get rid of all the following lines to read the next customer's record */
                             sc.nextLine();sc.nextLine();sc.nextLine();
                             sc.nextLine();sc.nextLine();sc.nextLine();
                             continue;     
    /* A return value of false indicates no duplicating record and the following
         lines containing the information of that customer's record is being read
         in */
                        if(d==false)
    /* sc.next() gets rid of "Name" and "=" and name is changed to upper case*/
         sc.next();sc.next();
         custName = sc.nextLine().toUpperCase();
    /* sc.nextLine get rids of the following lines to read the next customer's
         record if length of name is more than 20 characters*/
         if(custName.length()>21)
    System.out.println("Name of custId "+custId+" is more than 20 characters");
                                  System.out.println();
         sc.nextLine();sc.nextLine();sc.nextLine();sc.nextLine();
         continue;
    /* sc.next() gets rid of "Address" and "=" */           
         sc.next();sc.next();
         custAddress = sc.nextLine();
    /* sc.nextLine get rids of the following lines to read the next customer's
         record if length of address is more than 80 characters*/                         
                             if(custAddress.length()>81)
    System.out.println("Address of custId "+custId+" is more than 80 characters");
                                  System.out.println();
         sc.nextLine();sc.nextLine();sc.nextLine();sc.nextLine();
         continue;
    /* sc.next() gets rid of "DOB" and "=" */                              
         sc.next();sc.next();
         custBirthdate = sc.nextLine();
    /* sc.nextLine get rids of the following lines to read the next customer's
         record if length of date of birth is more than 10 characters*/                         
                             if(custBirthdate.length()>11)
    System.out.println("D.O.B of custId "+custId+" is more than 10 characters");
                                  System.out.println();
         sc.nextLine();sc.nextLine();sc.nextLine();sc.nextLine();
         continue;
    /* sc.next() gets rid of "Phone", "Number" and "=" */                              
         sc.next();sc.next();sc.next();
         custPhone = sc.nextLine();
    /* sc.nextLine get rids of the following lines to read the next customer's
         record if length of phone number is more than 8 characters*/                         
                             if(custPhone.length()>9)
    System.out.println("Phone no. of custId "+custId+" is more than 8 characters");
                                  System.out.println();
         sc.nextLine();sc.nextLine();sc.nextLine();sc.nextLine();
         continue;
    /* sc.next() gets rid of "Account", "Balance" and "=" */                              
         sc.next();sc.next();sc.next();
         custBalance = sc.nextDouble();
    /* sc.next() gets rid of "Account", "Type" and "=" */                              
                             sc.next();sc.next();sc.next();
                             custAccType = sc.next();
                             if(custAccType.equals("Saving"))
    customerList[noOfCustomers] = new Account1(custId,custName,custAddress,custBirthdate,custPhone,custBalance,custAccType);
    sc.nextLine();
                                                 noOfCustomers++;
                                                 i++;
    else if(custAccType.equals("Checking"))
    customerList[noOfCustomers] = new Account2(custId,custName,custAddress,custBirthdate,custPhone,custBalance,custAccType);
                                                 sc.nextLine();
                                                 noOfCustomers++;
                                                 i++;
    else if(custAccType.equals("Fixed"))
    sc.next();sc.next();sc.next();sc.next();
                                                 curRate = sc.nextDouble();
                                                 Account3 temp = new Account3(custId,custName,custAddress,custBirthdate,custPhone,custBalance,custAccType,curRate);
                                                 customerList[noOfCustomers]=temp;
                                                 sc.nextLine();
                                                 noOfCustomers++;
                                                 i++;
                             else
                                  System.out.println("Account type not defined.");
         if(noOfCustomers==30)
         System.out.println("The customer list has reached its maximum limit of 30 records!");
         System.out.println();
         return noOfCustomers;
    //Exceptions to be caught
    catch (FileNotFoundException e)
    System.out.println("Error opening file");
    System.exit(0);
    catch (IOException e)
    System.out.println("IO error!");
    System.exit(0);
    /* Bubblesort method used to sort the array in ascending alphabetical order
         according to customer's name */
    bubbleSort(customerList);
              return i;
    /* The method displayRecords() displays the data of the customer records on
         screen */
    public static void displayRecords()
    int k;
    /* Displaying text using the printf() method */
         for(k=0;k<noOfCustomers;k++)
         System.out.printf("Name = %s\n", customerList[k].getName());
         System.out.printf("Account Balance = %.2f\n", customerList[k].getBalance());
         System.out.printf("Account Id = %d\n", customerList[k].getId());
    System.out.printf("Address = %s\n", customerList[k].getAddress());
    System.out.printf("DOB = %s\n", customerList[k].getBirthdate());
    System.out.printf("Phone Number = %s\n", customerList[k].getPhone());
         String type = customerList[k].getAccType();
         System.out.println("Account Type = " +type);
    if(type.equals("Fixed"))
         System.out.println("Fixed daily interest = "+((Account3)customerList[k]).getFixed());
         System.out.println();               
    /* The method writeFile() saves the content from customerList into a
         specified text file. Data is printed on the screen at the same time */
    public static void writeFile()
    /* Try block to enclose statements that might throw an exception, followed by
    the catch block to handle the exception */
    try
    int i;
              int n=0;
    //PrintWriter class used to write contents of studentList to specified file
              FileWriter fwStream = new FileWriter("newCustomers.txt");
              BufferedWriter bwStream = new BufferedWriter(fwStream);
              PrintWriter pwStream = new PrintWriter(bwStream);     
    for(i=0;i<noOfCustomers;i++)
         pwStream.println("Account Id = "+customerList.getId());
              pwStream.println("Name = "+customerList[i].getName());
    pwStream.println("Address = "+customerList[i].getAddress());
    pwStream.println("DOB = "+customerList[i].getBirthdate());
    pwStream.println("Phone Number = "+customerList[i].getPhone());
              pwStream.printf("Account Balance = %.2f\n", customerList[i].getBalance());
              pwStream.println("Account Type = "+customerList[i].getAccType());
                   if(customerList[i].getAccType().equals("Fixed"))
                        pwStream.println("Fixed Daily Interest = "+((Account3)customerList[i]).getFixed());
              pwStream.println();
              n++;
    //Closure of stream
    pwStream.close();
              System.out.println(+n+" records written.");
    catch(IOException e)
    System.out.println("IO error!");     
    System.exit(0);
         //Deletes specified record from list
    public static void deleteRecord(int id)
    int i;
              i=locate(id);
    if(i==200)
    //checking if account to be deleted does not exist
    System.out.println("Error: no account with the id of "+id+" found!");
              //if account exists
    else
                        while(i<noOfCustomers)
                             customerList[i] = customerList[i+1];
                             i++;
                        System.out.println("Account Id: "+id+" has been deleted");
                        --noOfCustomers;
         //Updates the accounts
    public static void update(double interest)
    int i,j,k;
              double custBalance,addition=0;
    for(i=0;i<noOfCustomers;i++)
                        if(customerList[i] instanceof Account1)
                             for(j=0;j<30;j++)
                                  addition=customerList[i].getBalance()*interest;
                                  custBalance=customerList[i].getBalance()+addition;
                                  customerList[i].setBalance(custBalance);
                        else if(customerList[i] instanceof Account2)
                             continue;
                        else if(customerList[i] instanceof Account3)
                             for(j=0;j<30;j++)
    addition=customerList[i].getBalance()*((Account3)customerList[i]).getFixed();
    custBalance=customerList[i].getBalance()+addition;
    customerList[i].setBalance(custBalance);
                        else
                             System.out.println("Account type not defined");
              System.out.println("The updated balances are: \n");
              for(k=0;k<noOfCustomers;k++)
    System.out.printf("Name = %s\n", customerList[k].getName());
    System.out.printf("Account Balance = %.2f\n", customerList[k].getBalance());
    System.out.println();
    /* ================== Additional methods ==================== */     
    /* Bubblesort method to sort the customerList in ascending alphabetical
         order according to customer's name */
    public static void bubbleSort(Customer[] x)
    int pass, index;
    Customer tempValue;      
    for(pass=0; pass<noOfCustomers-1; pass++)          
    for(index=0; index<noOfCustomers-1; index++)
    if(customerList[index].getName().compareToIgnoreCase(customerList[index+1].getName()) > 0)
    tempValue = x[index];
    x[index] = x[index+1];
    x[index+1]= tempValue;
    /* Method used to check for duplicated ids in array */     
         public static boolean checkDuplicate(int id)
              int i;
              for(i=0;i<noOfCustomers;i++)
                   if(id == customerList[i].getId())
    System.out.println("Account Id = "+id+" already exists");
                        System.out.println();
    return true;
              }return false;
    /* Method to seach for account id in array */
         public static int locate(int id)
              int j;
              for(j=0;j<noOfCustomers;j++)
                   if(customerList[j].getId()==id)
                        return j;
              j=200;
              return j;
    import java.util.Scanner;
    public class Customer
    /* The following private variables are declared so that the data is only
         accessible to its own class,but not to any other class, thus preventing
         other classes from referring to the data directly */
         protected int id;               
         protected String name,address,birthdate,phone,accType;                              
         protected double balance;               
    // Null constructor of Customer
         public Customer()
              id = 0;
              name = null;
              address = null;
              birthdate = null;
              phone = null;
              balance = 0;
              accType = null;
    /* The following statements with the keyword this activates the Customer
         (int id, String name String address, String birthdate, String phone, double
         balance) constructor that has six parameters of account id, name, address,
         date of birth, phone number, account balance and assign the values of the
         parameters to the instance variables of the object */     
         public Customer(int id, String name, String address, String birthdate, String phone, double balance, String accType)
    //this is the object reference that stores the receiver object     
              this.id = id;
              this.name = name;                         
              this.address = address;
              this.birthdate = birthdate;
              this.phone = phone;
              this.balance = balance;
              this.accType = accType;
    /* The following get methods getId(), getName(), getAddress(), getBirthdate(),
         getPhone(), getBalance() return the values of the corresponding instance
         properties */     
         public int getId()
              return id;
         public String getName()
              return name;
         public String getAddress()
              return address;
         public String getBirthdate()
              return birthdate;
         public String getPhone()
              return phone;
         public double getBalance()
              return balance;
         public String getAccType()
              return accType;
    /* The following set methods setId(), setName(), setAddress(), setBirthdate(),
         setPhone and setBalance() set the values of the corresponding instance
         properties */
         public void setId (int custId)
              id = custId;
         public void setName(String custName)
              name = custName;
         public void setAddress (String custAddress)
              address = custAddress;
         public void setBirthdate (String custBirthdate)
              birthdate = custBirthdate;
         public void setPhone (String custPhone)
              phone = custPhone;
         public void setBalance (double custBalance)
              balance = custBalance;
         public void setAccType (String custAccType)
              accType = custAccType;
    class Account1 extends Customer
         public Account1(int id, String name, String address, String birthdate, String phone, double balance, String accType)
              super(id,name,address,birthdate,phone,balance,accType);
              this.id = id;
              this.name = name;                         
              this.address = address;
              this.birthdate = birthdate;
              this.phone = phone;
              this.balance = balance;
              this.accType = accType;
    class Account2 extends Customer
         public Account2(int id, String name, String address, String birthdate, String phone, double balance, String accType)
              super(id,name,address,birthdate,phone,balance,accType);
              this.id = id;
              this.name = name;                         
              this.address = address;
              this.birthdate = birthdate;
              this.phone = phone;
              this.balance = balance;
              this.accType = accType;
    class Account3 extends Customer
         protected double fixed=0;
         public Account3(int id, String name, String address, String birthdate, String phone, double balance, String accType, double fixed)
              super(id,name,address,birthdate,phone,balance,accType);
              this.id = id;
              this.name = name;                         
              this.address = address;
              this.birthdate = birthdate;
              this.phone = phone;
              this.balance = balance;
              this.accType = accType;
              this.fixed = fixed;
         public double getFixed()
              return fixed;
    Example of a customers.txt
    Account Id = 123
    Name = Matt Damon
    Address = 465 Ripley Boulevard, Oscar Mansion, Singapore 7666322
    DOB = 10-10-1970
    Phone Number = 790-3233
    Account Balance = 405600.00
    Account Type = Fixed
    Fixed Daily Interest = 0.05
    Account Id = 126
    Name = Ben Affleck
    Address = 200 Hunting Street, Singapore 784563
    DOB = 25-10-1968
    Phone Number = 432-4579
    Account Balance = 530045.00
    Account Type = Saving
    Account Id = 65
    Name = Salma Hayek
    Address = 45 Mexican Boulevard, Hotel California, Singapore 467822
    DOB = 06-04-73
    Phone Number = 790-0000
    Account Balance = 2345.00
    Account Type = Checking
    Account Id = 78
    Name = Phua Chu Kang
    Address = 50 PCK Avenue, Singapore 639798
    DOB = 11-08-64
    Phone Number = 345-6780
    Account Balance = 0.00
    Account Type = Checking
    Account Id = 234
    Name = Zoe Tay
    Address = 100 Blue Eyed St, Singapore 456872
    DOB = 15-02-68
    Phone Number = 456-1234
    Account Balance = 600.00
    Account Type = Saving

    1) When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    2) Don't just post a huge pile of code and ask, "How do I make this work?" Ask a specific question, and post just enough code to demonstrate the problem you're having.
    3) Don't just write a huge pile of code and then test it. Write a tiny piece, test it. Then write the piece that will work with or use the first piece. Test that by itself--without the first piece. Then put the two together and test that. Only move on to the next step after the current step produces the correct results. Continue this process until you have a complete, working program.

  • Need help in passing parameters from one page to another!

    Hi,
    I need to pass values that are retrieved from database from one page to another.
    But even when I use pageContext.putParameter(), I am not able to view the value in the 2nd page.
    Any pointers on how to pass parameters would be helpful..
    Thanks in advance!

    The requirement is on the main page there are 6 fields out of which 4 are read-only and are taken from the database and 1 is taken from database, but can be edited, and the 6th one is completly editable for the user. I am trying to pass these parameters using setForwardURL, and on the second page (Preview page, where all these fields are read-only), I am able to retrieve these parameters using pageContext.getParameters() and am able to display it as an exception but I am not able to set these into the fields using pageContext.putParameters().

Maybe you are looking for

  • Imac Video In option?

    Is it possible to use the new IMAC as the display device for a "shudder" windows PC with a VGA adapter? I don't have a lot fo desk space. Is USB an option?

  • Problem while converting Spool to PDF

    Hi, I am sending ALV report output to Spool then converting the Spool to PDF using  'CONVERT_ABAPSPOOLJOB_2_PDF'. I am able to send the mail but in the PDF, the first page contains data statistics(no. of records passed) but I want to supress it. I ne

  • IDVD will not burn disk

    My first problem was the stuck disk from the previous thread. The instructions worked and the disk came out on start up. Now the disk will not burn. The door opens on the yellow light , it pulsates for a while then the door closes. Then Nothing. I bu

  • How to configure Material Master

    Dear Guru, May I know how the steps to configure material master? Thank you. Rgds, Goh Yen

  • Printing a Brochure problem

    Hello, I am trying to make a brochure using Page's brochure templet. I managed to make a very nice one (first Time). However I am having a terrible time printing it. I Have an eMac with 10.4.6 installed, HP Business Inkjet 1200 and I am using Pages 0