Cheers,

out.println(); produces the correct character but I can't use it as I am
building a string in a java bean that the jsp file calls


tried yours and it ended up this the same result as \n

???

It is for a windows 2000 machine?


Here is the full bean method

public String createclan2000txt(){

    Connection databaseConnection = null;
    SQLManager manager;

    // Try to make database connection
    try
    {
      manager = SQLManager.getInstance();
      databaseConnection = manager.requestConnection("thebestofhealth");
      Statement stmt =
databaseConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet
.CONCUR_UPDATABLE);
      stmt.setFetchSize(25);


      ResultSet deliveryRS = stmt.executeQuery("SELECT Delivery.* FROM
Delivery WHERE (DeliveryBatch_ID = " + deliverybatch_ID + ")");



      String OutputString = "";
      String temp;



      //Get CityLink Account Number
      dbvariables accountnumber = new dbvariables();
      deliveryservicecode dsc = new deliveryservicecode();

      while (deliveryRS.next())
      {

      accountnumber.fetch("CityLinkAccountNumber");
      temp = accountnumber.getValue();
      OutputString = OutputString + temp  + "|";

      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("Order_ID"),30);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("consigneename"),
30);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("contactname"),30
);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("addressline1"),3
0);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("addressline2"),3
0);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("addressline3"),3
0);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("addressline4"),3
0);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("postcodeprefix")
,8);

      dsc.fetch(deliveryRS.getInt("deliveryservicecode_ID"));
      OutputString =
this.buildcitylinkstring(OutputString,dsc.getServicecode(),1);

      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("DeliveryInstruct
ions"),30);
      OutputString = this.buildcitylinkstring(OutputString,"0",1);
      OutputString = this.buildcitylinkstring(OutputString,"N",1);
      if (deliveryRS.getBoolean("SaturdayDelivery")){
          OutputString = this.buildcitylinkstring(OutputString,"Y",1);
      }
      else
      {
          OutputString = this.buildcitylinkstring(OutputString,"N",1);
      }
      OutputString = this.buildcitylinkstring(OutputString,"",30);
      OutputString =
this.buildcitylinkstring(OutputString,deliveryRS.getString("NumberofLabels")
,30);
      OutputString = OutputString + "\n;  //  <<< HERE IS THE PROBLEM THAT I
NEED THE RETURN?????
      }

      //close database and recordsets
      manager.returnConnection(databaseConnection);
      databaseConnection.close();


      return OutputString;
    }
    catch(SQLException sqle)
    {
      return "Fail SQLException:" + sqle;
    }
    catch(PoolPropsException cnfe)
    {
      return "Failed Connection pool:" + cnfe;
    }
  }

Any Ideas????


Cheers

Graham Cruickshanks
www.itsnotrocketscience.com



-----Original Message-----
From: Scott Evans [mailto:[EMAIL PROTECTED]]
Sent: 21 August 2000 17:23
To: [EMAIL PROTECTED]
Subject: Re: ASCII Codes


The carriage return is platform-dependent, so Windows and UNIX for example
represent it differenly. You have to ask the System object what it's using
to represent it:

char lineSeparator = System.getProperty("line.separator").charAt(0);

-----Original Message-----
From: Graham Cruickshanks [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 21, 2000 5:09 PM
To: [EMAIL PROTECTED]
Subject: ASCII Codes


I'm trying to write a | delimited file for a external program to parse

I.e.

390129|1326|David Gould|.|18 Huxley Way|Bishops
Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|
390129|1326|David Gould|.|18 Huxley Way|Bishops
Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|

The external program reads in the file incorrectly as the carriage return is
not reconised.

I was using \n to do this but it didn't work, I presume this is a unicode /
Ascii problem.

how do I write a carriage return in ASCII in java.

I've been trying things like this in my jsp file

<%
        int a = 0x0013;
        int b = 0x0010;
        Character c = new Character( (char)a );
        Character d = new Character( (char)b );

  String OutputString = "";
  OutputString = OutputString + "390129|1326|David Gould|.|18 Huxley
Way|Bishops Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|" + d + c;
  OutputString = OutputString + "390129|1326|David Gould|.|18 Huxley
Way|Bishops Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|";

%><%= OutputString %>

but to not joy

Graham Cruickshanks
www.itsnotrocketscience.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to