<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>No, Jolyon is correct, I got it wrong – Shortstring was always 256bytes but shortstring with a length was always length+1 bytes in memory.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Nevertheless, having a max of 255 ascii characters is a bit limiting in todays world. I don’t think many programmers still use shortstrings – at least I haven’t used it in any of my many projects since the old days of Turbo Pascal.<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'><br></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Kind Regards,<br>Stefan Mueller</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#585757'> <br></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#666699'>_______________________<br>R&D Manager<br>ORCL Toolbox LLP, Japan<br></span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://www.orcl-toolbox.com/" title="blocked::http://www.orcl-toolbox.com/"><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>http://www.orcl-toolbox.com</span></a><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> delphi-bounces@listserver.123.net.nz [mailto:delphi-bounces@listserver.123.net.nz] <b>On Behalf Of </b>Alister Christie<br><b>Sent:</b> Thursday, January 19, 2012 6:08 AM<br><b>To:</b> NZ Borland Developers Group - Delphi List<br><b>Subject:</b> Re: [DUG] [computing]XE2 string conversion question<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>From memory (which is not as good as it use to be), Delphi 1* introduced variable length strings, String[32] was a string of up to 32 characters (I think it's actually size was 33 bytes - an extra byte to indicate length stored in position 0). Prior to that strings were always 256 bytes (1 length byte and 255 character bytes) - which when you only have 64k of memory....<br><br>*It may have been a version of Turbo Pascal.<br><br><o:p></o:p></p><pre>Alister Christie<o:p></o:p></pre><pre>Computers for People<o:p></o:p></pre><pre>Ph: 04 471 1849 Fax: 04 471 1266<o:p></o:p></pre><pre><a href="http://www.salespartner.co.nz">http://www.salespartner.co.nz</a><o:p></o:p></pre><pre>Follow us on Twitter <a href="http://twitter.com/salespartner">http://twitter.com/salespartner</a><o:p></o:p></pre><pre>PO Box 13085<o:p></o:p></pre><pre>Johnsonville<o:p></o:p></pre><pre>Wellington <o:p></o:p></pre><p class=MsoNormal><br>On 17/01/2012 9:48 p.m., Jolyon Smith wrote: <o:p></o:p></p><p class=MsoNormal>@Stefan <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Of course there are reasons to use short strings, just as there are reasons for using ANSIString, RawByteString and all the other string types. Horses for courses.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>In the case of short strings, the reasons are the same reasons there always were - most especially for use in records used for structured file access (file of <record type>). And I am not so sure about the idea that 255 bytes are always allocated - surely the whole point of a declared short string type of a specified length is that it will hold a string of that declared length, come what may. <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Otherwise using file of <record type> containing short string fields would never have worked!<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>+0.02<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Jolyon<o:p></o:p></p></div><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>NZ Borland Developers Group - Delphi mailing list<o:p></o:p></pre><pre>Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><o:p></o:p></pre><pre>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a><o:p></o:p></pre><pre>Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<o:p></o:p></pre></div></body></html>