Article View: news.software.readers
Article #256572Re: 40tude Dialog: Which programming language used for scripts?
From: Sqwertz
Date: Thu, 26 Dec 2013 07:54
Date: Thu, 26 Dec 2013 07:54
31 lines
2785 bytes
2785 bytes
On Thu, 26 Dec 2013 01:29:48 -0600, Sqwertz wrote: > On Wed, 25 Dec 2013 16:00:15 -0600, VanguardLH wrote: > >> In what programming language are scripts written? I thought it was >> Delphi (aka Object Pascal). If so, doesn't the zeroth element (index 0) >> of a string hold the length of the string and is not part of the string >> itself? >> >> In C and for a string on N characters in length, you would walk through >> indexes 0 to N-1 to look at each character in the string. For Pascal, >> don't you use 1 to N? > > No. You use 0 to N-1. Just like in C and every other language I've > used (except some old ROM-based versions of BASIC didn't have a [0] > element to arrays). > > Disclaimer: I don't claim to be a Delphi guru (hate it, in fact), but > I do have some scripts that do a bunch of string manipulation. I started second-guessing myself and looked at some code. It appears the length IS stored in [0] only for ShortString data types - mainly used in older versions of Delphi. I assume Dialog is built with the newer and default Unicode string formats. If you declare a string with a constant as in string[1-255] it looks like you may get a ShortString data type. Disclaimer still applies :-) -sw
Technical Details
Message-ID:
<1s3t8etujs4vr.dlg@sqwertz.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mailReferences:
<l9fkhh$kvt$1@dont-email.me> <jt1yynbv5idj.dlg@sqwertz.com>Show Full Headers
Complete Article Headers
Message-ID: <1s3t8etujs4vr.dlg@sqwertz.com> Subject: Re: 40tude Dialog: Which programming language used for scripts? Date: Thu, 26 Dec 2013 01:54:03 -0600 From: Sqwertz <swertz@cluemail.compost> References: <l9fkhh$kvt$1@dont-email.me> <jt1yynbv5idj.dlg@sqwertz.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Newsgroups: news.software.readers Organization: Me, Myself, and Inc. Lines: 31 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: mx05.eternal-september.org; posting-host="a09a102d82db2287d379077022972651"; logging-data="4404"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RxGjRm0cs8+ZNIwuFNgK5" User-Agent: Thunderbird 2.0.0.23 (X11/20091001) Cancel-Lock: sha1:K8+yZLPEpXFyLx8k8CuNE6GblVc= X-no-archive: yes X-WebTV-Stationery: X-WebTV-Stationery: Standard; BGColor=red; Background="http://fhg.perfectladyboys.com/50053/images/6.jpg"; TextColor=red X-Original-Bytes: 2433