Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #1774

Re: BBC BASIC, Long Strings, And BeagleBoard

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!news.osn.de!diablo2.news.osn.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date Mon, 04 Jun 2012 09:49:26 -0500
Date Mon, 04 Jun 2012 15:49:10 +0100
From Gavin Wraith <gavin@wra1th.plus.com>
Newsgroups comp.sys.acorn.programmer
Subject Re: BBC BASIC, Long Strings, And BeagleBoard
Message-ID <1dac989a52.wra1th@wra1th.plus.com> (permalink)
References <4ca81a1d-7657-4dbb-9868-2c29a25e7f2c@f30g2000vbz.googlegroups.com> <a33s0lFu5U1@mid.individual.net>
Organization Home
User-Agent Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.18) NewsHound/v1.50-32
Lines 32
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-gFGrzJkFLpXPo77BYQxXqwI+VJjIGVNptwP/O0M/44EuL74uYYWAbxq7UgwxJCzZLRP6rLoZpMGFRfS!8EaQPBMiPCH0O56LSJAiOKpo/vSkLbVb0KrAbzmaj4aiguWMIVfyXDo9W4S9o5n/t9DUBv5aIXjk!atNg
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2714
Xref csiph.com comp.sys.acorn.programmer:1774

Show key headers only | View raw


In message <a33s0lFu5U1@mid.individual.net>
          "David Holden" <SpamBin@apdl.co.uk> wrote:
 
> Secondly it's best not to use Basic strings for this sort of thing anyway. A
> 'string' is just a collection of bytes, and you can put them in an integer
> array and access them with the indirection operators rather then the Basic
> string functions. That way they can be as long as you like.
> 
> > How do I now save, and reload these from a basic data file?  I am
> > currently use PRINT# and INPUT#.
> 
> Yuk! Those should have been shot long ago. Either arrange your data in a
> block of memory and load and save that (much quicker), or if you must save
> and load it a bit at a time use BPUT# and GET$# or BGET#. They don't do
> everything backwards.

I second David Holden's advice. My kneejerk reaction when I see issues
about long strings in Basic is to beat the drum and say "Why use Basic
when you could use RiscLua, which does not have those problems?". However,
I recently wrote an article for Drag'n'Drop, "The difference words can make
(compared to bytes)", comparing two RiscLua programs to extract data from
toolbox Res files. One program used Lua strings and the io library (ANSI
compatible approach), the other used dim-ed arrays and sys-calls to OS_File 
(RISC OS only approach). The latter program was 150% faster and 3/4
the size - basically because loading a word at a time is faster than loading 
four individual bytes. The program was also much closer in spirit and 
appearance to what the corresponding Basic program would be, following 
the afore-mentioned advice. 

-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

BBC BASIC, Long Strings, And BeagleBoard Michael <michaelremerton@gmail.com> - 2012-06-04 03:19 -0700
  Re: BBC BASIC, Long Strings, And BeagleBoard "David Holden" <SpamBin@apdl.co.uk> - 2012-06-04 13:37 +0000
    Re: BBC BASIC, Long Strings, And BeagleBoard Gavin Wraith <gavin@wra1th.plus.com> - 2012-06-04 15:49 +0100
      Re: BBC BASIC, Long Strings, And BeagleBoard Michael <michaelremerton@gmail.com> - 2012-06-04 17:20 -0700
        Re: BBC BASIC, Long Strings, And BeagleBoard "David Holden" <SpamBin@apdl.co.uk> - 2012-06-05 06:37 +0000
          Re: BBC BASIC, Long Strings, And BeagleBoard spampling <spam.pling@btinternet.com> - 2012-06-05 10:13 +0100
            Re: BBC BASIC, Long Strings, And BeagleBoard "John Williams (News)" <UCEbin@tiscali.co.uk> - 2012-06-05 12:06 +0200
              off-topic -  was Re: BBC BASIC, Long Strings, And BeagleBoard spampling <spam.pling@btinternet.com> - 2012-06-05 16:25 +0100
          Re: BBC BASIC, Long Strings, And BeagleBoard Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2012-06-15 08:37 +0200
            Re: BBC BASIC, Long Strings, And BeagleBoard "David Holden" <SpamBin@apdl.co.uk> - 2012-06-15 08:58 +0000
              Re: BBC BASIC, Long Strings, And BeagleBoard Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2012-06-15 17:37 +0200
                Re: BBC BASIC, Long Strings, And BeagleBoard Paul Sprangers <Paul@sprie.nl> - 2012-06-15 18:34 +0200
              Re: BBC BASIC, Long Strings, And BeagleBoard Frank de Bruijn <zuiderduin@hotmail.com> - 2012-06-16 08:25 +0200
                Re: BBC BASIC, Long Strings, And BeagleBoard "David Holden" <SpamBin@apdl.co.uk> - 2012-06-16 07:57 +0000
                Re: BBC BASIC, Long Strings, And BeagleBoard Steve Drain <steve@kappa.me.uk> - 2012-06-16 11:00 +0100
                Re: BBC BASIC, Long Strings, And BeagleBoard Michael <michaelremerton@gmail.com> - 2012-08-06 01:28 -0700
                Re: BBC BASIC, Long Strings, And BeagleBoard Frank de Bruijn <zuiderduin@hotmail.com> - 2012-06-16 12:05 +0200
        Re: BBC BASIC, Long Strings, And BeagleBoard Richard Russell <news@rtrussell.co.uk> - 2012-06-07 06:29 -0700
      Re: BBC BASIC, Long Strings, And BeagleBoard jgh@arcade.demon.co.uk (Jonathan Graham Harston) - 2012-06-05 20:59 +0100

csiph-web