Dynamically read data from a txt document

I try to dynamically read data from a txt document
in swf
stop ();
var pafh=this;
import flash.events.*;
var Araray_id:Array =new Array();
var v_length:Number;
var myTextLoader:URLLoader = new URLLoader();
myTextLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
        Araray_id = e.target.data.araray_id.split(",");
        trace("Araray_id: "+Araray_id);
        v_length=Araray_id.length;
        trace("v_length: "+v_length);
        for (var i:Number=0;i<v_length;i++){
            pafh["Id_"+i]=new Array();
            trace("pafh[Id_+i]: "+pafh["Id_"+i]);
            var v_help:Object="id_"+i;
            trace("v_help: "+v_help);
            //pafh["Id_"+i]= e.target.data.v_help.split(",");????? Here stops the script
            //pafh["Id_"+i]= e.target.data.(v_help).split(",");????Here stops the script
            //pafh["Id_"+i]= e.target.data.[v_help].split(","); ????Here stops the script
        play();
myTextLoader.load(new URLRequest("myText1.txt"));
in text
araray_id=aa,bb,cc,dd,ee,ff
&id_0=aa1,aa2,aa3,aa4
&id_1=bb1,bb2,bb3,bb4,bb5
&id_2=cc1,cc2,cc3
&id_3=dd1,dd2,dd3,dd4,dd5,dd6
&id_4=ee1,ee2
&id_5=ff1,ff2
output
Araray_id: aa,bb,cc,dd,ee,ff
v_length: 6
pafh[Id_+i]:
v_help: id_0
TypeError: Error #1010: A term is undefined and has no properties.
    at skuskaceatarraybiforas3fromtext_fla::MainTimeline/onLoaded()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
Can you help me with this problem

More suggestions.
1. If you align naming conventions between data and your application - reading data could be practically a one-liner.
If you write pafh["id_" + i] (with small case i) instead of pafh["Id_" + i] (with capital case I) the function can be just:
function onLoaded(e:Event):void
          for (var prop:String in e.target.data)
                    pafh[prop] = e.target.data[prop].split(",");
          play();
2. If changing conventions is not feasible, here is another thing you can do:
function onLoaded(e:Event):void
          for (var prop:String in e.target.data)
                    pafh[prop.replace(/^\w/, String(prop.match(/^\w/)).toUpperCase())] = e.target.data[prop].split(",");
          play();

Similar Messages

  • How to read data from a .txt file?

    currently i'm under study on java
    while need to extract data from a hyperterminal or .txt file
    could any one help me in this problem.?
    as in txt or .ht got their own overhead .( or what u call it. tt identify the file type)
    so how to open it and read data one ah?
    thanks all.

    Here's a code snippet 4 u
    String sInput = null;
    FileInputStream sStream = new FileInputStream("yourTxtFile");
    BufferedReader fileIn = new BufferedReader(new InputStreamReader(sStream));
    while((sInput = fileIn.readLine()) != null){
    System.out.println(sInput);
    hope this help
    *-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read data from a .txt file in real time

    Hi
    I am running a fortran code which takes around 1 week to run and output data are continuously saved in .txt files. I want to display these data and plot it against time in labview.
    Lets say I have a array of real numbers starting from 1.0 , and every 2-3 sec another number is added (output of code). So I dont want end-of-file-reached error in my program and also want program to wait until next data is updated in .txt file.
    I tried to make a simple read_txt_file.vi, but I am getting problems in terms of continous reading. Help !! Help !!
    Pl see the attached vi.
    Thanx
    PKJ
    Attachments:
    FileReader.vi ‏43 KB
    labview.txt ‏18 KB

    Hi PKJ,
          I modified your VI and it seems to do what you asked, that is, display the data from a file as the data is being added.
    Hope it helps!
    Message Edited by Dynamik on 11-08-2005 04:32 PM
    Message Edited by Dynamik on 11-08-2005 04:34 PM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    FileReader.vi ‏52 KB

  • Unable to read data from an excel document of 365*24 values ( all rounded to 4 decimal points)

    I have an excel sheet containing data of hourly loads in MW( rounded to 4 decimals) of one year.  So, I have 365*24 values that I want to import to Labview using Read from spreadsheet.vi. However what i get in the output array is 0's and randomly some unit values at very few places. I have checked the array size of the output array and it shows different array sizes for different yearly data.
    I am attaching the four excel spreadsheets .
    Plz help me with the issue I am facing.
    Attachments:
    Load-2012.xlsx ‏95 KB
    Load-2013.xlsx ‏94 KB
    Load-2014.xlsx ‏59 KB

    If you are using LabVIEW 2014, it includes the Report Generation Toolkit (which is also available as an add-on in earlier LabVIEW Versions).  This can read native Excel files, including .xlsx.  With a few functions (3 or 4, I think), you should be able to get the entire Table into a 2D array.
    Bob Schor

  • Help! I want to read data from a txt file

    the data file is like this:
    b     a     v
    c     d     s
    c     c     d
    c     d     a
    c     c     c
    d     c     d
    c     c     c
    the total number of rows is big.
    How can I read it to an array without knowing the row number (array size)?
    Thanks.

    this is the part I finished.
    It will stop at 1000th line (I gave the initial array size 1000.)
    Is it because of this "for (int i=0; i<data.length; i++, k++) "
    so it stopped at the original size?
    import java.io.*;
    import java.util.*;
    public class test {
         private static void enlarge_array (String [][]data, int addsize) {
              String temp[][] = new String [data.length][data[0].length];
              System.arraycopy(data, 0, temp, 0, data.length);
              data = new String [data.length+addsize][data[0].length];
              System.arraycopy(temp, 0, data, 0, temp.length);
         public static void main (String args[]) throws IOException {
              int size = 1000;
              String data[][] = new String [size][4];
              BufferedReader br = new BufferedReader (new FileReader (args[0]));
              int k = 1;
              for (int i=0; i<data.length; i++, k++) {
                   StringTokenizer st = new StringTokenizer(br.readLine(), "     ");
                   for (int j=0; j<4; j++) {
                        data[i][j] = st.nextToken();
                   if (k==size) {
                        enlarge_array(data, size);
                        k=1;

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • Populate a table reading the data from a TXT file

    how can I populate a table reading the data from a TXT file?
    thanks

    Hey Kevin!
    Using FORMS.TEXT_IO to bulk load data from a file strikes me as re-inventing the wheel. It is just about justifiable in a self-service environment, but I regard the EXTERNAL TABLE is a better solution for that situation as well.
    The same applies to UTL_FILE. I think the ability to read text with UTL_FILE is primarily intended for read file-based configuration or file manipulation/processing rather than data loading.
    Re-writing a text file into SQL statements is too much like hard work (even with an editor that supports macro definition and regular expressions) for no real benefit. You lose all the bulk load peformance you would get from SQL*Loader. But for QAD I'd probably let you off with it.
    You missed out one obvious alternative: using Java to turn the contents of an XML file into a CLOB and inserting it into a table which is read by a PL/SQL procedure that parses the XML records and insert the retrieved data into a table.
    Stay lucky, APC

  • Reading data from dynamically from different file.

    Is there any function moudle or class to read data from a file in application layer, whoes structure is changing dynamically.
    Urgent....... Can any one help me out in this......
    Thanks in advance....
    Thanks,
    feroz.

    Hi Feroz,
    Do u mean that structure of the file on the application server is changing dynamically.
    The following is the FM to read data from a file on Application Server.
    OPEN DATASET FNAME FOR INPUT in text mode encoding default.
    LOOP AT TAB INTO WA.
      READ DATASET FNAME INTO WA.
      IF SY-SUBRC  0.
        EXIT.
      ENDIF.
      WRITE: / WA-COLUMN1, WA-COLUMN2.
      ENDLOOP.
    This is the FM to search the file on Application Server.
    F4_DXFILENAME_TOPRECURSION
    Regards,
    Sai
    Edited by: Sai Krishna Kowluri on Jul 15, 2008 9:45 AM

  • Dynamic Internal Table for reading data from external file

    Hello All,
    The task was to create a internal table with dynamic columns,
    Actually this is my first task in the WebAS 6.20, my program is based on input file provided by user with certain effort. this file can have different effort for a one yr to five year frame..
    I needed to read the raw data from file, based on months create a internal table to hold the data, after this i need to validate the data...
    I have browsed thru dynamic internal table topic, but couldn't find any dynamic appending structure, the dynamic structure would contains 12 month fileds.
    can any one help me in getting my task completed..
    Thanks
    Kumar

    Hi,
    I see that you posted the same question a couple of days ago at Dynamic Internal Table for reading data from external file Didn't Charles's response address your problem?
    Regards

  • What is the 'quickest' way to read char data from a txt file

    Hello,
    What is the 'quickest' way to read character data from a txt file stored on the phone to be displayed into the screen?
    Regards

    To be even a bit more constructive...
    Since J2me does not have a BufferedInputStream, it will help to implement it yourself. It's much faster since you read large blocks at ones in stread of seperate chars.
    something line this lets you read lines very fast:
      while ( bytesread < filesize ) {
             length = configfile.read( buff, 0, buff.length );
             // append buffer to temp String
             if ( length < buff.length ) {
                byte[]  buf  = new byte[length];
                System.arraycopy( buff, 0, buf, 0, length );
                tmp.append( new String( buf ) );
             } else {
                tmp.append( new String( buff ) );
             // look in tmp string for \r\n
             idx1 = tmp.toString().indexOf( "\r\n" );
             while ( idx1 >= 0 ) {
                //if found, split into line and rest of tmp
                line = tmp.toString().substring( 0, idx1 );
             /// ... do with it whatever you want ... ////
                tmp = new StringBuffer( tmp.toString().substring( idx1 + 2 ) );
                idx1 = tmp.toString().indexOf( "\r\n" );
             bytesread += length;
          }

  • Reading data from a XML file.

    Hi,
      I am new user to webdynpro and has the task of reading data from XML file.The file is created using XML form Builder and is stored at a location.But my code gives me the path instead of the content in the data.
    The code is :
    try
          IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
           com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
    // create an ep5 user from the retrieved user
           IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
           IResourceContext context = new ResourceContext(ep5User);
    /Specify the path of ur document here./
           RID pathRID = RID.getRID("/documents/70f51182-84c3-2710-ce91-8d5fbfde713d.xml");
           //RID pathRID = RID.getRID("/documents/hol.txt");
           wdContext.currentContextElement().setSetDisp(pathRID.toString());
           IResource resource = ResourceFactory.getInstance().getResource(pathRID, context);                       
           InputStream in = resource.getContent().getInputStream();
           ByteArrayOutputStream out = new ByteArrayOutputStream();
           byte[] buffer = new byte[4096];
           int bytesread = 0;
           while ((bytesread = in.read(buffer)) != -1)
               out.write(buffer, 0, bytesread);
           String myData = out.toString();
    /*myFile will containS the content of the document./
           wdContext.currentContextElement().setSetDisp(myData);
           catch (Exception e)
            // wdContext.currentContextElement().setTextdisp("IO Error:" + e.getMessage());
    text data is read from the location but XML data is not read.
    Please help me out.

    hi SriRam,
      For some reasons you are not able to change the value of attribute SetDisp ahich you gave the default value as the path using the following statement
    wdContext.currentContextElement().setSetDisp(myData);
    Remove that line.First try to open the files using creating new window instance
    IWDWindow window =
                wdComponentAPI.getWindowManager().createExternalWindow(
                      "http://<server name>:<port no>/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs"
                            + "/documents/Public Documents/...."
                            + "/"
                            +<name>,
                      "from km repository",
                      false);
          window.open();
    Then we can be sure that the error is due to reading data using input stream
    Regards
    Rohit

  • Retreival of Dynamic Table Datas from Adobe to WebDynpro- ABAP

    Dear Friends,
    I have Developed an application in Webdynpro-ABAP, where i have integrated Adobe form in the webdynpro.
    In the adobe form, dynamic table is there where we can add and delete the rows at runtime.
    I am trying to retreive the table datas at runtime from the adobe.
    I can able to retreive only the first record from the table, even if the table contain more than one rows.
    As per the below code i have retreived the count, where it is showing the count as 1.
    using the method get_static_attributes_table i am trying to fetch all the records, but i can able to retreive only the first record.
    lo_nd_zsm_fm_transport_tra = wd_context->get_child_node( name = wd_this->wdctx_zsm_fm_transport_tra ).
      lo_nd_tr_details_i = lo_nd_zsm_fm_transport_tra->get_child_node( name = wd_this->wdctx_tr_details_i ).
    count = lo_nd_tr_details_i->GET_ELEMENT_COUNT( ).
    elems_bank_table = lo_nd_tr_details_i->get_elements( ).
    lo_nd_tr_details_i->get_static_attributes_table(
      importing
        table = ls_tr_details_i ).
    Even Cardinality i have maintained as 1.N for the node.
    Kindly provide me the solution.
    Thanks and Regards,
    Sathish,,

    Hi, I have solution for read data from dynamic table and add these added row to WD4A context (and then save them to DB) (in ONACTIONPROCESS_SUBMIT event):
    DATA: l_fp TYPE REF TO if_fp.
    l_fp = cl_fp=>get_reference( ).
    DATA: l_pdfobj TYPE REF TO if_fp_pdf_object.
    l_pdfobj = l_fp->create_pdf_object( ).
    l_pdfobj->set_document( pdfdata = lv_pdfsource ).
    l_pdfobj->set_extractdata( ).
    l_pdfobj->execute( ).
    DATA: pdf_form_data TYPE xstring.
    l_pdfobj->get_data( IMPORTING formdata = pdf_form_data ).
    DATA: converter TYPE REF TO cl_abap_conv_in_ce, formxml TYPE string.
    Converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).
    Converter->read( IMPORTING data = formxml ).
    TYPE-POOLS: ixml.
    DATA: l_ixml TYPE REF TO if_ixml.
    l_ixml = cl_ixml=>create( ).
    DATA: streamfactory TYPE REF TO if_ixml_stream_factory,
    istream TYPE REF TO if_ixml_istream.
    streamfactory = l_ixml->create_stream_factory( ).
    istream = streamfactory->create_istream_string( formxml ).
    DATA: document TYPE REF TO if_ixml_document.
    Document = l_ixml->create_document( ).
    DATA: parser TYPE REF TO if_ixml_parser.
    parser = l_ixml->create_parser( stream_factory = streamfactory
                                               istream = istream
                                               document = document ).
    Parser->parse( ).
    the code above allows you to read xml data from pdf file, then you need only to read xml and adding rows to your context:
    data : item type string.  DATA: nodechild TYPE REF TO if_ixml_node,
            Childschild TYPE REF TO if_ixml_node.
        data: num_of_children type i,
              x type i,
              y type i,
              num_of_attribute.
    node = document->find_from_name('ZAM_PROTSTROJF').
    num_of_children = node->num_children( ).
    nodechild = node->get_first_child( ).
    data: wa_strojdetail type ZAM_PROTSTROJF,
          wa_strojdetail_tab TYPE TABLE OF ZAM_PROTSTROJF.
    wa_strojdetail-docnum = ls_zam_protstroj-docnum.
    wa_strojdetail-bukrs = 'VVS'.
    wa_strojdetail-mandt = sy-mandt.
    y = 1.
    do Num_of_children times.
           num_of_attribute = nodechild->num_children( ).  " Childschild->num_children( )." Getting the number of attributes
           Childschild = nodechild->get_first_child( ).
           wa_strojdetail-itemnum  = y.
           x = 1.
           do num_of_attribute times.
              item = Childschild->GET_value( ).
              CASE x.
                WHEN 4.
                  wa_strojdetail-anln1 = item.
                WHEN 5.
                  wa_strojdetail-anln2 = item.
                WHEN 6.
                  wa_strojdetail-bubtr = item.
                WHEN 7.
                  wa_strojdetail-belnr = item.
              ENDCASE.
              Childschild = Childschild->get_next( ).
              x = x + 1.
          enddo.
          y = y + 1.
          APPEND wa_strojdetail to wa_strojdetail_tab.
          nodechild = nodechild->get_next( ).
    enddo.
    This is complete solution for adding rows in interactive forms and working with them in WD4A!
    Regards Jiri
    Edited by: Jiri Neuzil on Jun 10, 2009 8:13 AM
    Sorry for formatting, but I don't know, how to format text correctly on this site in plain text I have all text correctly formatted, but in preview....

  • Read data from a text file, one line at a time.

    I need to read data from a text file, and display each line in a String Indicator on Front Panel. It displays each line, but I get Error 4, End Of Line, unless I enter an extra line of data in the file that I don't need. I tried Read From Text File.vi, made by Nat Instr, and it gave the same error.

    The Read from Text File.vi reads data from a text file line by line until the user stops the VI manually with the Stop button on the front panel, or until an error (such as "Error 4, End of file") occurs. If an error occurs, the Simple Error Handler.vi pops up a dialog that tells you which error occurred.
    The Read from Text File.vi uses a while loop, but if you knew how many lines you wanted to read, you could replace the while loop with a for loop set to read that many lines from the file.
    If you need something more dynamic because the number of lines in your files vary, then you could change the code of the Read from Text File.vi to the expect "Error 4, End of file" and handle it appropriately. This would require unbundling the error cluster that comes fro
    m the Read File function with the Unbundle By Name function, so that you can expose the individual error "status" and error "code" values stored in the cluster. If the value of the error "code" is 4, then you can change the error "status" from true to false, and you can rebundle the cluster with the Bundle by Name function. Setting the error "status" to false instructs the Simple Error Handler to ignore the error. Otherwise, pass the original error cluster to the Simple Error Handler.vi, so that you can see what the error is.
    Of course, if you're not interested in what the errors are, you could just remove the Simple Error Handler.vi, but then you wouldn't see any error messages.
    Best of Luck,
    Dieter
    Dieter Schweiss
    Applications Engineer
    National Instruments

  • How to Read Data from a table (horizontal axsis) in an existing report

    Hi to all,
    I've a question. I must read the data in a table of an existing report. I develope with BO XI 3.0
    I don't know how to reach the table in my report from SDK.
    this is my code:
    reports = document.getReports();
    rep = reports.getItem(0);     
    the report has the title and a table horizontal axsis.
    I must read the column name(header column) of the table and all rows for retrieving values.
    Thank u in advance for your attention.

    hi ChinMay,
    thank u for your answer.
    I would like to ask u if Ireport refers crystal reports, while i mean to read data from a webi report.
    I've tried in many manners to read this data and i've read the SDK, but i'm unable to reach the table of my report for reading its rows. i'm able to export in XML format, i'm able to get reportelement , block, but in the java's example of SDK its not present how to obtain the reportbody and subsequently the section or directly a table. the example that i've seen show that if u create a new report u can create the reportbody, the section, the table and others. But don't show how to obtain this from an existing report.
    Probably i don't understand very well all the SDK structure and i think that is possbile to read a table(with horizantal axis) in a report without section only passing by the ReportBody.
    I know that u don't have so time to spent for things that are in the SDK, but if it's possible to have ten rows of sample about this question i'll be very happy.
    If it's not possibile, thank u very much for your interesting and disponbility and i'll try again and again and again to solve this.
    Matteo

  • Read data from a sequential file to fill an arrray

    I am trying to read data from a sequential file to fill an array and then use the array for calculations. I believe my program is reading the file; however when I try to use the data for calculations the results show up as boxes rather than numbers. Can someone please take a look and give me some insight into where I am going wrong. The sequential file has the following data:
    5.0
    5.35
    5.5
    5.75
    Here is my code from that portion of the program. I can send the entire program if necessary.
    private void calcResults(TextArea loanResults, double amount, double interest, int term ) throws IOException {
         DecimalFormat df = new DecimalFormat("$###,###.00");
         NumberFormat formats = new DecimalFormat("#0.00");
         StringBuffer buffer=new StringBuffer();
         loanResults.append("Month No.\tMonthly Payment\t\tInterest\t\tBalance\n");
         double monthlyPay = amount*Math.pow(1+interest,term)*interest/(Math.pow(1+interest,term)-1);
         monthlyPayment.setText("" + (formats.format(monthlyPay)));
         double principal= amount;
          * Loop through each month of a given loan
        int month;
         for (int i=0; i<term; i++)
    try {
         int j = 0;
         BufferedReader in = new BufferedReader(new FileReader("rates.txt"));
         String temp = "";
         while((temp = in.readLine()) != null) {     
            j++;
            strRate[j] = temp;
            RateValue1 = Double.parseDouble(loanAmountTxFld.getText());
            in.close();
             catch (FileNotFoundException e) {
                 System.out.println("Can't find file rate.txt!");
                 return;
          month= i+1;
          double rate =principal*interest;
          double balance=principal+rate-monthlyPay;
          loanResults.append((month) + "\t\t" + (formats.format(principal) + "\t\t"  + (formats.format(rate) + "\t\t"
                            + (formats.format(balance)     + "\n"))));
          principal=balance;
          GraphArea.append(formats.format(balance)     + "\n");
    *Method for determining which loan option was chosen
    private void calc() throws IOException{
      String interestTerms = (String) cOption.getSelectedItem();
      if (interestTerms.equalsIgnoreCase("5 yrs at 5.00"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.05/12, 60);
      else if (interestTerms.equalsIgnoreCase("7 yrs at 5.35"))
        calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), RateValue1/12, 84);
      else if (interestTerms.equalsIgnoreCase("15 yrs at 5.50"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.0550/12, 180);
      else if (interestTerms.equalsIgnoreCase("30 yrs at 5.75"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.0575/12, 360);
      else if (interestTerms.equalsIgnoreCase("       "))
        calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), Double.parseDouble(loanInterestTxFld.getText())/100/12,Integer.parseInt(loanTermTxFld.getText())*12);
    }

    ok, I fixed my program per your suggestion and I still cannot get it to work. I get the same result where the ouput is just a bunch of boxes. I also tried to print to see what I am getting and all I see is the values of the array [5.0,5.35,5.5,5.75] but I cannot seem to pass that to the calculations. I wish I could figure this out. Does anybody have any suggestions as to what I am doing wrong. This is the portion of my code that I am having issues with:
    private void calcResults(TextArea loanResults, double amount,double interest, int term ) throws IOException {
         DecimalFormat df = new DecimalFormat("$###,###.00");
         NumberFormat formats = new DecimalFormat("#0.00");
         StringBuffer buffer=new StringBuffer();
         loanResults.append("Month No.\tMonthly Payment\t\tInterest\t\tBalance\n");
         double monthlyPay = amount*Math.pow(1+interest,term)*interest/(Math.pow(1+interest,term)-1);
         monthlyPayment.setText("" + (formats.format(monthlyPay)));
         double principal= amount;
          * Loop through each month of a given loan
        int month;
         for (int i=0; i<term; i++)
          month= i+1;
          double rate =principal*interest;
          double balance=principal+rate-monthlyPay;
          loanResults.append((month) + "\t\t" + (formats.format(principal) + "\t\t"  + (formats.format(rate) + "\t\t"
                            + (formats.format(balance)     + "\n"))));
          principal=balance;
          GraphArea.append(formats.format(balance)     + "\n");
    private void readFile() throws IOException
    try {
         int j = 0;
         BufferedReader in = new BufferedReader(new FileReader("rates.txt"));
         String temp = "";
         while((temp = in.readLine()) != null) {     
            strRate[j] = temp;
            j++;
    RateValue1 = Double.valueOf(((String)(strRate[1]))
    ).doubleValue();
    //        RateValue1 = Double.parseDouble(loanAmountTxFld.getText());
            in.close();
             catch (FileNotFoundException e) {
                 System.out.println("Can't find file rates.txt!");
                 return;
    *Method for determining which loan option was chosen
    private void calc() throws IOException{
      String interestTerms = (String) cOption.getSelectedItem();
      if (interestTerms.equalsIgnoreCase("5 yrs at 5.00"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.05/12, 60);
      else if (interestTerms.equalsIgnoreCase("7 yrs at 5.35"))
        calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), RateValue1/12, 84);
      else if (interestTerms.equalsIgnoreCase("15 yrs at 5.50"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.0550/12, 180);
      else if (interestTerms.equalsIgnoreCase("30 yrs at 5.75"))
         calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), 0.0575/12, 360);
      else if (interestTerms.equalsIgnoreCase("       "))
        calcResults(loanResults, Double.parseDouble(loanAmountTxFld.getText()), Double.parseDouble(loanInterestTxFld.getText())/100/12,Integer.parseInt(loanTermTxFld.getText())*12);
      }

Maybe you are looking for

  • PSE 11 on WIN 8.1

    Ran pse 11 on WIN 7.  Upgraded to 8.1.  Cannot get downloads to open on 8.1.  What is the trick or secret code?

  • Mac OS X 10.6.5 fixes sync issue after upgrading to new MobileMe calendar

    The issue that prevented iSync from 'seeing' calendars after upgrading to the new MobileMe Calendar has been fixed in iSync 3.1.2, part of the Mac OS X 10.6.5 update.

  • How to add contact names under Company in contacts

    I switched to Android yesterday from the iPhone. In the Contacts app there appears to be no way to add a personal contact under the business name. If there is no way to do this (and are you kidding me if there isn't) what contact manager do you use i

  • Want to find my friends stolen Iphone

    How can i find a my friends phone? I have the Imei and the Serial number. We used to try to do this by here Icloud account but it was signt off.. Now im trying to find the phone by Serial Number and Imei. Can somebody help me?

  • BB10 runs native Android by partitioning?

    Since there is not a BB10 support site yet. I will throw the question out here as PlayBook is QNX based. After reading an old thread about running IOS on the Playbook, so why not run Android on PlayBook under BB10? Why do it in a round about way usin