Rate this code.. related to file IO

I am a newbie to Labview... kindly say possible corrections in this
This VI is an application that is capable of Sync the files between Source path and Target Path.
The following Features are necessary,
 Upon pressing check button the s/w should do the steps 1,2,3.
  1) It should compare the files in the source path (Recursively) with the Target Path Recursively.
  2) It should List all the Missing files (in the target path ).
  3) It should list all the Modified files (based on file properties size and date modified.
  4) Upon pressing copy the software should copy the missing files to the target location
  5) upon pressing update the software should update the modified files only(Replace the old files in the
 target location by the new version from source).
  6) upon pressing Sync it has to do both steps 4 and 5.
  7) Exit - Exits the application.
P.S: In simple words, Assume that you are developing an Application that sync the songs to a MP3 player.
Make all other Assumptions and develop the application.
Attachments:
Jason2.zip ‏55 KB

You already got two sets of excellent answers, so here are some cleanup operations for a few more issues I noticed:
Some of your buttons overlap on the FP. This causes possibly performance problems redrawing the panel. (check,sync)
You don't need a timeout case. It does nothing once you fix point (3) below.
The terminals of latch action booleans belong inside their respective event structures. This way they reset to FALSE when the event fires (In your case, they get read before the event fires and thus don't reset until after the action occured and the timeout event spins the idle loop once more.
If you would replace the big case structure with an event structure, you don't need any state information
Don't use hidden indocators ("Boolean") to keep state information. A shift register will do.
You don't need to check for "=exit", just read the exit button.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Need a small change in this code, GUI_DOWNLOAD. FILE NAME ??

    Hi All,
    I want to write a program to download data from VBAK. I have tried this and working fine but I have made my file name constant. Instead I want user to make a choice of file name and its location to save.
    Also please review this code and let me know, how can I improve my programming skills...
    *& Report  ZSAI1
    REPORT  ZSAI1.
    tables : vbak.
    data : begin of it_vbak occurs 0,
           vbeln like vbak-vbeln,
           auart like vbak-auart,
           audat like vbak-audat,
          end of it_vbak.
    data : i_filename type string value 'C:\Documents and Settings\venki\Desktop\text.xls'.
    selection-screen begin of block sc1 with frame.
    select-options : s_vbeln for vbak-vbeln.
    selection-screen  Skip 3.
    parameters : i_excel radiobutton group Rb1,
                 i_text radiobutton group Rb1.
    selection-screen end of block sc1.
    perform select_dt.
    if i_excel = 'X'.
      perform download_excel.
    endif.
    *&      Form  download_excel
    FORM download_excel .
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = i_filename
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = it_vbak
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " download_excel
    *&      Form  download_text
    FORM download_text .
    ENDFORM.                    " download_text
    *&      Form  select_dt
    FORM select_dt .
    select vbeln auart audat from vbak
           into table it_vbak where
           vbeln in s_vbeln.
    ENDFORM.                    " select_dt
    Thank You once gain.
    Regards
    Venkat
    Message was edited by:
            venkat Kumbham

    Check the below code :
    REPORT ZSAI1.
    tables : vbak.
    data : begin of it_vbak occurs 0,
    vbeln like vbak-vbeln,
    auart like vbak-auart,
    audat like vbak-audat,
    end of it_vbak.
    data v_file type string.
    *data : i_filename type string value
    *'C:\Documents and Settings\venki\Desktop\text.xls'.
    selection-screen begin of block sc1 with frame.
    select-options : s_vbeln for vbak-vbeln.
    selection-screen Skip 3.
    parameters p_file like rlgrap-filename.
    parameters : i_excel radiobutton group Rb1,
    i_text radiobutton group Rb1.
    selection-screen end of block sc1.
    at selection-screen on value-request for p_file.
    F4 value for file
      perform file_get.
    start-of-selection.
    perform select_dt.
    if i_excel = 'X'.
    perform download_excel.
    endif.
    *& Form download_excel
    FORM download_excel .
    v_file = p_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = v_file
    FILETYPE = 'ASC'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = it_vbak
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " download_excel
    *& Form download_text
    FORM download_text .
    ENDFORM. " download_text
    *& Form select_dt
    FORM select_dt .
    select vbeln auart audat from vbak
    into table it_vbak where
    vbeln in s_vbeln.
    ENDFORM. " select_dt
    *&      Form  file_get
          text
    -->  p1        text
    <--  p2        text
    FORM file_get.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_PATH         = 'C:\Temp\'
                MASK             = ',.,..'
                MODE             = 'O'
                TITLE            = 'Select File'(007)
           IMPORTING
                FILENAME         = P_file
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
    ENDFORM.                    " file_get
    Thanks
    Seshu

  • How to  print pdf file by using java print API ? I am trying with this code

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

  • Memory leak with large files and this code?

    Okay, so the following code will not complete. 
    Basically what I am doing is opening 5 files and generating a PDF document from the already opened Report file, which is renewed prior to the PDF export operation.  I left out the general stuff at the start.  I am also writing out the location of the PDF to a HTML file, which acts as an index of the exported PDF documents.
    I believe it is due to some sort of memory leak issue, but it could be something else or just my code.  I have not stepped through this code, but for small file sizes of say less than 40 megs per file, it works fine.  For file sizes along these lines:
    File 1 = 230 megs
    File 2,3 = 26 megs
    File 4,5 = 8 megs
    it will belch erors at the end of about the 5th iteration through the For loop.  It will complete the 5th iteration however.  Here are the errors generated:
    84   10/26/2006 9:35:15 AM Error:
    85   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
         (Error no. 6)
    86   10/26/2006 9:40:19 AM Error:
    87   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p2.TDM" file is invalid.
         (Error no. 6)
    88   10/26/2006 9:45:17 AM Error:
    89   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p3.TDM" file is invalid.
         (Error no. 6)
    90   10/26/2006 9:53:07 AM Error:
    91   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p8.TDM" file is invalid.
         (Error no. 6)
    92   10/26/2006 10:00:39 AM Error:
    93   File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p9.TDM" file is invalid.
         (Error no. 6)
    94   10/26/2006 10:01:01 AM Error:Error occured during file creation.
    95   10/26/2006 10:01:01 AM Error:
         Error in <GM315 Pa...sing.VBS> (Line: 185, Column: 5):
         File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
         (Error no. 6)
    For files of a larger size, like:
    File 1 = 7500 megs
    File 2,3 = 80 megs
    File 4,5 = 25 megs
    This occurs after about 2-3 iterations through the loop.
    see attachment for code.
    Attachments:
    ForLoopCode.txt ‏11 KB

    i am having a similar error randomly inserted in the log 
    25   10/1/2009 1:58:36 PM Error:
    26   File handle for "C:\Program Files\Summitek\Spartan\data\tdm\S Parameter Test $SSN$ 49.TDMS" file is invalid.
         (Error no. 6)
    and
    31   10/1/2009 1:58:37 PM Error:
    32   File handle for "C:\Program Files\Summitek\Spartan\www\temp\Test_$SSN$ 49_602313172.pdf" file is invalid.
         (Error no. 6)
    it doesn't seem to be causing an immediate problem, but i have had several unexplained Diadem lockups.
    they occur in log after i use CALL DATAFILELOADSEL and CALL PICpdfexport
    help? what does this mean
    jim

  • What's the problem of  uploading file in this code

    hi,
    i have written following code for uploading a an image file. But when i run this pogram in Eclipse3.1.2 then it shows following Error:
    I have written following file for selecting a file
    <body>
    <form action="display.jsp" method="POST" enctype="multipart/form-data">
    <input type="file" name="File1">
    <input type="submit" name = "button" >
    </form>
    </body>
    display.jsp file contain the following code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <%@page import="org.apache.commons.fileupload.*" %>
    <%@page import="java.io.*" %>
    <%@page import="java.util.*" %>
    </head>
    <body>
    File uploaded
    <%
         boolean isMulti = FileUpload.isMultipartContent(request);
    DiskFileUpload upload=new DiskFileUpload();
         List items=upload.parseRequest(request);
         Iterator iter=items.iterator();
         while(iter.hasNext()){
              FileItem item=(FileItem)iter.next();
              if(item.isFormField()){
                   String name=item.getFieldName();
                   String value=item.getString();
                   %>
                   <%=name%>
                   <%=value %>
              <%}else {
              InputStream stream=item.getInputStream();
              OutputStream os=new FileOutputStream("d:/image.jpg");
              int bytesRead = 0;
              byte[] buffer = new byte[8192];
              while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
              os.write(buffer, 0, bytesRead);
              os.close();
              stream.close();
              item.delete();
    %>
    </body>
    </html>Error is:
    org.apache.jasper.JasperException: Exception in JSP: /display.jsp:19
    16:
    17:      boolean isMulti = FileUpload.isMultipartContent(request);
    18: DiskFileUpload upload=new DiskFileUpload();
    19:      List items=upload.parseRequest(request);
    20:      Iterator iter=items.iterator();
    21:
    22:      while(iter.hasNext()){
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.display_jsp._jspService(display_jsp.java:103)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
         org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:102)
         org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
         org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
         org.apache.jsp.display_jsp._jspService(display_jsp.java:62)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Is there anybody can help me? Why this code is not working. I have used Tomcat5.5 for the server. Please help me
    With regards
    Bina

    You should have commons-fileupload.jar in common/lib or in ur applications lib directory( I mean WEB-INF/lib). Dont forget to set the build path to commons-fileupload.jar in Eclipse.
    Go to
    project > properties > Java Build Path > libraries > click on Add External Jars button > choose ur commons-fileupload.jar file > click on OK

  • What files does this code need?

    I am trying to use this code from Java Examples In A Nutshell.
    It is a short program that involves reading one and writing to another (I think!) The way I understand things is that there has to be two files for the program to be able to run, from_file & to_file . I have attempted to creat two txt files and saved them as these names in the same folder as the app. The code complies as you would expect, when I try to run it I get Usage: FileCopy <source> <destination> and the app never runs. I suspect I have not created the external files properly. If you can see where I have gone wrong let me know, layman's terms please, Dave.

    When running the compiled "FileCopy.class" with java command you must enter the names of files, i.e.;
    java FileCopy "from_file" "to_file"
    in the command line.
    In this case args[0] is "from_file" and args[1] is "to_file."

  • I've updated my phone and I've made a backup. but now it says I must enter my code to restore all my files and I haven't got this code. If I cancel the process or choose something else, all my stuff will be deleted, and I really don't want that.

    I've updated my phone and I've made a backup. but now it says I must enter my code to restore all my files and I haven't got this code. If I cancel the process or choose something else, all my stuff will be deleted, and I really don't want that.
    HELP ME PLEASE!!!

    If, for some reason, your backup got encrypted and you don't know the code, you'll have to set up your phone as new device and start all over again without the backup.
    Warning: If you encrypt an iPhone backup in iTunes and then forget your password, you will not be able to restore from backup and your data will be unrecoverable. If you forget the password, you can continue to back up and use the device, however you will not be able to restore the encrypted backup to any device without the password. You do not need to enter the password for your backup each time you back up or sync.
    If you cannot remember the password and want to start again, you must perform a full software restore and when iTunes prompts you to select the backup from which to restore, choose set up as a new device.
    If you can't get pass the lock screen, connect in recovery mode and restore the phone, you'll have the option to reset the lock secreen passcode.
    iOS: Unable to update or restore and iPhone and iPod touch: Wrong passcode results in red disabled screen
    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone, iPad and iPod touch software.

  • I keep getting this error message when I (right-click) on a photo file on my desktop to burn to a CD. I don't understand this code...does anyone?  Thanks  Ariel**:The disc can't be burned because an unexpected error occurred (error code 0x80020000).

    I keep getting this error message when I (right-click) on a photo file on my desktop to burn to a CD. I don't understand this code...does anyone?  Thanks  Ariel**:    The disc can’t be burned because an unexpected error occurred (error code 0x80020000).

    I tried every obvious solution to this problem with different types of disc (-R; +R; -RW and +RW) and the problem persisted.  Then I read about removing a hyphen in picture filenames.  I renamed all the images and bingo there were no further problems.  Apple should have solved this by now.  This error code has been reported for several years and my MacBook Pro is quite new.  Anyway, I hope this helps.  It does work.
    Piggywiggle

  • Can someone please tell me on how to modify this code so that I dont have to enter the file name at all?

    Hello
    can someone please tell me how to modify this code so that I dont have to enter the file path at all? When i give the same file path constants to both the read and write VIs I'm getting an error message.
    Attachments:
    read and write.vi ‏11 KB

    Yup use the low level File I/O opening the reference once, and closing it once.  
    As for the path selection you have an unwired input which is the path to use.  Programatically set that and you won't be prompted to select a path.  Usually this is done with a path constant to a folder, then using the Build Path, to set the file name in that folder.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Log error "Could not load file or assembly 'BarcodeConversion' or one of its dependencies. Access is denied. This code work fine in server 2008 but get this error in server 2012

    This code work fine in server 2008, but get this error in server 2012.  Do yo have any idea?

    Need some more info as to where this is installed and how.
    First thing to try would be to uninstall the solution and reinstall.
    Check the GAC for your assembly as well as web.config.
    If you don't see it in one of those places, something went wrong with the install and you'll need to start over.
    Brandon James SharePoint Developer/Administrator

  • How do I code relative links as function parameters within Templates?

    I am a newcomer looking for best practices for a "How Do I?" properly code relative links as function parameters within an Adobe template (DWT) which accomodates page creation at 2 different level of folders. Dreamweaver doesn't appear to handle auto-correction of relative links as function parameters as far as I can see.  It's not clear to me what the best practice I should be following.  While this is not exactly a SPRY question, I am hoping that someone using the Spry.Data.XMLDataSet had already found the best practice to use.
    My Site
    -- Multiple pages at this level    and the parameter needs to be "_includes/UnitSideNavigation.xml"
    SubFolder
    -- Other pages at this level.       and the parameter needs to be "../_includes/UnitSideNavigation.xml"
    And this is the particular code snippet within a non edtable template area I would like to work for 2 levels of pages created from the template.
    <script type="text/javascript">
    var dsItems1 = new Spry.Data.XMLDataSet("_includes/UnitSideNavigation.xml", "/links/firstlevel");
    var dslinks = new Spry.Data.NestedXMLDataSet(dsItems1, "secondlevels/secondlevel");
    </script>
    My environment is Windows/Vista using latest CS4 dreamweaver.
    Any pointers appreciated. This is learn time for me. Hope I have made myself clear. Andy

    I use serverside includes instead of DWT for exactly that reason. Not only that, if you change anything within the template you must re-upload all of the files affected by the change; only the modified include file needs to be uploaded.

  • Error while generating java client code from wsdl file

    I am trying to generate a java client code from WSDL file um_workflowSaveCreateProfile.wsdl which includes um_workflowSaveCreateProfile_interface.wsdl file, so I am keeping both the files in the same folder and trying to generate the client code but it is showing me the below error highlighted .
    um_workflowSaveCreateProfile.wsdl
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="E:/DIPPWF/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:oblix="http://www.oblix.com/" xmlns:obinterface="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile" targetNamespace="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile">
         <import namespace="D:/DIPP/WSDL/um_workflowSaveCreateProfile_interface" location="um_workflowSaveCreateProfile_interface.wsdl"/>
         <service name="OblixIDXML_um_workflowSaveCreateProfile_Service">
              <port name="OblixIDXML_um_workflowSaveCreateProfile_Port" binding="obinterface:OblixIDXML_um_workflowSaveCreateProfile_Binding">
                   <soap:address location="http://localhost:7777/identity/oblix/apps/userservcenter/bin/userservcenter.cgi"/>
              </port>
         </service>
    </definitions>
    um_workflowSaveCreateProfile_interface.wsdl
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:oblix="http://www.oblix.com/" xmlns:oblixxmllocalschema="http://www.oblix.com/OblixXMLLocalSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface" targetNamespace="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface">
         <types>
              <xsd:schema targetNamespace="http://www.oblix.com/" elementFormDefault="qualified"
                   xmlns="http://www.oblix.com/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                        <xsd:include schemaLocation="../XMLSchema/common_parameters.xsd" />
                        <xsd:include schemaLocation="../XMLSchema/common_authentication.xsd" />
                        <xsd:include schemaLocation="../XMLSchema/workflowSaveCreateProfile.xsd" />
              </xsd:schema>
              <xsd:schema targetNamespace="http://www.oblix.com/OblixXMLLocalSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:element name="request">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="params">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element ref="oblix:ObWorkflowName"/>
                                                 <xsd:element ref="oblix:ObDomainName"/>
                                                 <xsd:element ref="oblix:ObWfComment" minOccurs="0"/>
                                                 <xsd:element ref="oblix:noOfFields"/>
                                                 <xsd:element ref="oblix:AttributeParams"/>
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:sequence>
                             <xsd:attribute name="version" type="xsd:string" use="optional"/>
                             <xsd:attribute name="application" type="xsd:string" use="required" />
                             <xsd:attribute name="function" type="xsd:string" use="required" />
                             <xsd:attribute name="mode" type="xsd:string" use="optional"/>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:schema>
         </types>
         <message name="OblixIDXMLInput">
              <part name="authentication" element="oblix:authentication"/>
              <part name="request" element="oblixxmllocalschema:request"/>
         </message>
         <message name="OblixIDXMLOutput">
              <part name="body" element="oblix:Oblix"/>
         </message>
         <portType name="OblixIDXMLPortType">
              <operation name="OblixIDXML_um_workflowSaveCreateProfile">
                   <input message="tns:OblixIDXMLInput"/>
                   <output message="tns:OblixIDXMLOutput"/>
              </operation>
         </portType>
         <binding name="OblixIDXML_um_workflowSaveCreateProfile_Binding" type="tns:OblixIDXMLPortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="OblixIDXML_um_workflowSaveCreateProfile">
                   <soap:operation soapAction="http://www.oblix.com/"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
         </binding>
    </definitions>
    I am using WSDL2 Java for generating the client code .
    Please suggest where am I wrong .
    E:\axis2-1.4\bin>WSDL2Java -uri E:\DIPPWF\um_workflowSaveCreateProfile.wsdl -p R
    ND -d adb -s -o build\client--http-proxy-host 10.74.93.35 --http-proxy-port 80
    Using AXIS2_HOME: E:\axis2-1.4
    Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_02
    Retrieving document at 'E:\DIPPWF\um_workflowSaveCreateProfile.wsdl'.
    Retrieving document at 'um_workflowSaveCreateProfile_interface.wsdl', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_parameters.xsd', relative to 'f
    ile:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_authentication.xsd', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/workflowSaveCreateProfile.xsd', relati
    ve to 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'navbar.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/workfl
    owSaveCreateProfile.xsd'.
    Retrieving schema at 'searchform.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/wo
    rkflowSaveCreateProfile.xsd'.
    Retrieving schema at 'component_basic.xsd', relative to 'file:/E:/DIPPWF/XMLSche
    ma/workflowSaveCreateProfile.xsd'.
    Retrieving schema at 'displaytype.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/c
    omponent_basic.xsd'.
    Retrieving schema at 'error.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/compone
    nt_basic.xsd'.
    Retrieving schema at 'component_workflowTicket.xsd', relative to 'file:/E:/DIPPW
    F/XMLSchema/workflowSaveCreateProfile.xsd'.
    Retrieving document at 'E:\DIPPWF\um_workflowSaveCreateProfile.wsdl'.
    Retrieving document at 'um_workflowSaveCreateProfile_interface.wsdl', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_parameters.xsd', relative to 'f
    ile:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_authentication.xsd', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/workflowSaveCreateProfile.xsd', relati
    ve to 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'navbar.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/workfl
    owSaveCreateProfile.xsd'.
    Retrieving schema at 'searchform.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/wo
    rkflowSaveCreateProfile.xsd'.
    Retrieving schema at 'component_basic.xsd', relative to 'file:/E:/DIPPWF/XMLSche
    ma/workflowSaveCreateProfile.xsd'.
    Retrieving schema at 'displaytype.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/c
    omponent_basic.xsd'.
    Retrieving schema at 'error.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/compone
    nt_basic.xsd'.
    Retrieving schema at 'component_workflowTicket.xsd', relative to 'file:/E:/DIPPW
    F/XMLSchema/workflowSaveCreateProfile.xsd'.
    *[ERROR] More than one part for message OblixIDXMLInput*
    org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
    More than one part for message OblixIDXMLInput
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1162)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1085)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBindi
    ng(WSDL11ToAxisServiceBuilder.java:686)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    int(WSDL11ToAxisServiceBuilder.java:538)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    ints(WSDL11ToAxisServiceBuilder.java:489)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:363)
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
    llServices(WSDL11ToAllAxisServicesBuilder.java:107)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:147)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
    : Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:153)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    Caused by: org.apache.axis2.AxisFault: More than one part for message OblixIDXML
    Input
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:397)
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
    llServices(WSDL11ToAllAxisServicesBuilder.java:107)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:147)
    ... 2 more
    Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessin
    gException: More than one part for message OblixIDXMLInput
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1162)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1085)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBindi
    ng(WSDL11ToAxisServiceBuilder.java:686)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    int(WSDL11ToAxisServiceBuilder.java:538)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    ints(WSDL11ToAxisServiceBuilder.java:489)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:363).
    Thanks in advance.
    akshay

    Hello,
    Were you able to resolve this issue ?
    I am seeing the same issue and at my wits end.
    regards
    Amit

  • URGENT Check this code for me please

    Dear whoeverthisreads, please read and see at the bottom my sourcecode, or whatever I could make of it until (even with help) I failed to see any solution. Please copy, paste and run to see if you can manage to adjust the program to make it work in the way as described. And I think I made it unnecessarily complicated. Whatever you can do for me, I will be very, very grateful.
    Prem Pradeep, email: [email protected]
    (A beginning dutch Java student who is running out of time and hope)
    Catalogue Manager
    Specification:
    a) Develop an object to represent to encapsulate an item in a catalogue. Each CatalogueItem has three pieces of information: an alphanumeric catalogue code, a name, and a price (in dollars and cents), that excludes sales tax. The object should also be able to report the price, inclusive of a 15% sales tax, and the taxed component of the price.
    b) Work out a way to be able to support the inc tax/ex tax price accessors, and the tax component accessor, without needing to store any additional information in the object.
    c) Use an array of 5 CatalogueItem items to store data. (You may assume that no imported goods will be recorded.)
    d) Write a driver program that prompts for three sets of user input (catalogue number, description and price), to be stored in the atalogueItem instance.
    e) The data are to be read for each item in a single line. The data lines will be in the format:
    CatNo:Description:Price
    Use a StringTokenizer object to separate these data lines into their components.
    f) Review the class definition of CatalogueItem, and use modifiers where appropriate to:
    � Ensure that data is properly protected;
    � Ensure that the accessors and mutators are most visible;
    � The accessors and mutators for the catalogue number and description cannot be overridden.
    � The constant for the tax rate is publicly accessible, and does not need an instance of the class
    present in order to be accessible.
    As well as a summary, the program should also calculate and display:
    � All of the cheapest and most expensive item(s) in the catalogue. In the case of more than one
    item being the cheapest (or most expensive), they should all be listed.
    � A total of the pre-tax worth of the goods in the catalogue.
    � The average amount of tax on the items in the catalogue.
    A sample execution of the program may be as follows (output should be tabulated):
    Enter five items of data:
    AA123: Telephone: 52.00
    ZJ282: Pine Table: 98.00
    BA023: Headphones: 23.00
    ZZ338: Wristwatch: 295.00
    JW289: Tape Recorder: 23.00
    LISTING OF ALL GOODS
    Cat      Description      ExTax           Tax           IncTax ~
    ZJ282      pine Table           98.00           14.70           112.70
    AA123 Telephone           52.00           7.80           59.80
    BA023 Headphones      23.00           3.45           26.45
    ZZ338      Wristwatch      295.00      44.25      339.25
    JW289 Tape Recorder      23.00           3.45           26.45
    CHEAPEST GOODS IN CATALOGUE
    Cat      Description      ExTax           Tax           IncTax
    BA023 Headphones           23.00           3.45           26.45
    JW289 Tape Recorder      23.00           3.45           26.45
    MOST EXPENSIVE GOODS IN CATALOGUE
    Cat      Description      ExTax           Tax           IncTax
    ZZ338      Wristwatch      295.00      44.25      339.25
    TOTAL PRE-TAX WORTH OF CATALOGUE ITEMS:      491.00
    AVERAGE AMOUNT OF TAX PAYABLE PER ITEM:      14.73
    The next code is what I could make of it�until I got terribly stuck...
    //CatalogueItem.java
    import java.io.*;
    import java.text.DecimalFormat;
    import java.util.StringTokenizer;
    public class CatalogueItem {
    private static final double TAXABLE_PERCENTAGE = 0.15;
    private String catalogNumber;
    private String description;
    private double price;
    /** Creates a new instance of CatalogueItem */
    public CatalogueItem() {
    catalogNumber = null;
    description = null;
    price = 0;
    public CatalogueItem(String pCatalogNumber, String pDescription, double pPrice) {
    catalogNumber = pCatalogNumber;
    description = pDescription;
    price = pPrice;
    void setCatalogNumber(String pCatalogNumber) {
    catalogNumber = pCatalogNumber;
    String getCatalogNumber() {
    String str = catalogNumber;
    return str;
    void setDescription(String pDescription) {
    description = pDescription;
    String getDescription() {
    String str = description;
    return str;
    void setPrice(String pPrice) {
    price = Double.parseDouble(pPrice);
    double getPrice() {
    double rprice = price;
    return formatDouble(rprice);
    double getTaxAmount(){
    double rTaxAmount = price * TAXABLE_PERCENTAGE;
    return formatDouble(rTaxAmount);
    double getIncTaxAmount() {
    double rTaxAmount = price * (1 + TAXABLE_PERCENTAGE);
    return formatDouble(rTaxAmount);
    double formatDouble(double value) {
    DecimalFormat myFormatter = new DecimalFormat("###.##");
    String str1 = myFormatter.format(value);
    // System.out.println("String is " + str1);
    // System.out.println("The format value : " + value);
    return Double.parseDouble(str1);
    public static void main(String[] args) throws IOException {
    final int MAX_INPUT_SET = 5;
    final String strQ = "Enter five items of data:";
    CatalogueItem[] catalogList = new CatalogueItem[MAX_INPUT_SET];
    String strInput;
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    String header = "Cat\tDescription\tExTax\tTax\tInc Tax";
    String lines = "---\t-----------\t------\t---\t-------";
    // Input of five items with three data each, delimiter ":"
    for (int i = 0; i < MAX_INPUT_SET; i++) {
    catalogList[i] = new CatalogueItem();
    System.out.print(strQ);
    strInput = stdin.readLine();
    StringTokenizer tokenizer = new StringTokenizer(strInput, ":" );
    String inCatNo = tokenizer.nextToken();
    String inDescr = tokenizer.nextToken();
    String inPrice = tokenizer.nextToken();
    catalogList.setCatalogNumnber(inCatNo);
    catalogList[i].setDescription(inDescr);
    catalogList[i].setPrice(inPrice);
    // Listing of all goods
    System.out.println("LISTING OF ALL GOODS");
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_INPUT_SET; i++) {
    System.out.println(
    catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    // This should pick the cheapest and most expensive goods in catalogue, but
    // this code is not good:
    // In the case of more than one item being the cheapest (or most expensive),
    // they should all be listed.
    double cheapest = cataloguelist[1].getPrice();
    double mostExpensive = cataloguelist[1].getPrice();
              for(int i=2; i< MAX_INPUT_SET; i++){
                   if (cataloguelist[i].getPrice < cheapest)
              cheapest = i;}
              for(int i=2; i< MAX_INPUT_SET; i++){
                   if (cataloguelist[i].getPrice > mostExpensivet)
              mostExpensive = i;}
    // Lists cheapest goods (not complete enough)
    i = cheapest;
    System.out.println("CHEAPEST GOODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    System.out.println(
    catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    // Lists most expensive goods (not complete enough)
    i = mostExpensive;
    System.out.println("MOST EXPENSIVE GOODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    System.out.println(
    catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());}}
    // Generates and shows total pre-tax worth of catalogue items (how??)
    // generates and shows amount of tax payable per item (how??)

    How is this:
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class Cat
         Vector items = new Vector();
    public Cat()
    public void read(String fname)
         FileReader     fr;
        BufferedReader br;
         String         str ="";
        try
             fr = new FileReader(fname);
            br = new BufferedReader(fr);
            while ((str = br.readLine()) != null && items.size() < 30)
                   if (!str.trim().equals(""))
                        StringTokenizer tokenizer = new StringTokenizer(str, ":");
                     String n = tokenizer.nextToken().trim();
                        String d = tokenizer.nextToken().trim();
                        String s = tokenizer.nextToken().trim();
                        double p = Double.parseDouble(s);
                        items.add(new Item(n,d,p));
            fr.close();
        catch (FileNotFoundException e)
            System.out.println("Input file cannot be located, please make sure the file exists!");
            System.exit(0);
        catch (IOException e)
            System.out.println(e.getMessage());
            System.out.println("Application cannot read the data from the file!");
            System.exit(0);
    public void displayAll()
         for (int j=0; j < items.size(); j++)
              Item item = (Item)items.get(j);
              System.out.println(item.toString());
    public void sort()
         Collections.sort(items);     
    public class Item implements Comparable
         String       number, description;
         double       price,pricep;
         final double TAXRATE = 0.15;
    public Item(String number, String description, double price)
         this.number      = number;
         this.description = description;
         this.price       = price;
         this.pricep      = price * TAXRATE;
    public int compareTo(Object o1)
         String o = ((Item)o1).number;
         return(number.compareTo(o));
    public String toString()
         DecimalFormat df = new DecimalFormat("#.00");     
         String        p1 = df.format(TAXRATE*price);
         String        p2 = df.format(TAXRATE*price+price);
         String s = number+"\t "+description+"\t"+price+"\t"+p1+"\t"+p2+"\t" ;
         return(s);
    public static void main (String[] args)
         Cat catalog = new Cat();
         catalog.read("C31.dat");
         String reply = "";
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         while (!reply.equals("e"))
              System.out.println("");
            System.out.println("CATALOGUE MANAGER: MAIN MENU");
            System.out.println("============================");
            System.out.println("a) display all goods        b) display cheapest/dearest goods");
            System.out.println("c) sort the goods list      d) search the good list");
            System.out.println("e) quit");
            System.out.print("Option:");
              try
                   reply = stdin.readLine();
              catch (IOException e)
                System.out.println("ERROR:" + e.getMessage());
                System.out.println("Application exits now");
                System.exit(0);
              if (reply.equals("a")) catalog.displayAll();
              if (reply.equals("c")) catalog.sort();
    Noah

  • "UNDEFINED" code in image file

    I have several "Undefined_2" name codes related to a header I
    created in Fireowrks and exported in html to Dreamweaver. Are the
    "undefined" codes a result of the header I created in Fireworks? I
    exported it as an html file, so hoped it would be one whole file
    for Dreamweaver. How can I fix this?
    Thanks!
    Link to file: www.revbootcamp.com/NEWREV/NewIndex.html
    Thank you!

    > www.revbootcamp.com/NEWREV/NewIndex.html
    <img src="../spacer.gif" alt="" name="undefined_2"
    guessing, you didn't set a default name/ID for the spacer gif
    that fireworks
    uses to prop table cells open.
    it's not a problem.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Currency changes rates through TBEX from excel file getting erro

    Hi,
    When i am trying to upload the currency changes rates through TBEX from excel file getting error message:
    Error "The macro 'ThisWorkbook.TableBackToR3' cannot be f" occurred during macro execution
    Kindly guide what macro i need to define in excel sheet. or should i need to activate something in excel sheet relates to macros.
    Regards,
    Salil...

    When you call it the first time, it new Shell() constructs a new Display for you (the default).
    The second time, it gets the default display, but you are in a different Thread now. Since you have to create your widgets in the UI thread, it gives you that error.
    To run code in the UI thread, Display provides two methods:
    display.syncexec(..)and
    display.asyncexec(...)see
    http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/swt_threading.htm
    for more details.

Maybe you are looking for

  • How do i get my image to fill the whole page in pages

    I am making an epub book and would like the image on my cover page to fill the whol page without the large white borders around it. How can I do that in pages. I know you can't export a document as an epub if it has floating objects in it but i don;t

  • Total - Sum of a function

    Hi All, The following is a test I performed in order to check a problem I got. I created a simple function in Oracle which receives a number and returns it divided by 2. (NUM/2). I registered this function in Discoverer Administrator and then created

  • Free goods condition is not deleted when pricing date changes

    Hi experts, we want to use the free goods condition type 'NA00' / 'NRAB' with category '3' (inclusive rebate).  The condition records are valid a certain period ( 1 month e.g.). The system inserts the condtion 'NRAB' in the calculation scheme and cal

  • RFC Lookup Table Parameters Reusability

    Dear All My Requirement is to Map fields in IDoc from the File data ,there are some fields in idoc for which i need to fetch data from SAP. For this i am using RFC Look up. i am retrieving values from table parameters for RFC. and this Table paramete

  • Week wise schedule quantities

    Hello Team, We are maintaining the schedule lines in SA with daily indicator. The same is showing in EKET . Now I would like to know is there any table or report which shows the same information in week wise .. Do you have any Idea. I have tried to g