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


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

Re: Font_DecodeMenu

From Martin Wuerthner <spamtrap@mw-software.com>
Newsgroups comp.sys.acorn.programmer
Subject Re: Font_DecodeMenu
Date 2011-06-15 13:18 +0200
Organization MW Software
Message-ID <a995b3e351.martin@bach.planiverse.com> (permalink)
References <51e32acc58Paul@sprie.nl> <mpro.lmsv0p01nzmww01kn.news@stevefryatt.org.uk> <4df83a04$0$14668$ba4acef3@reader.news.orange.fr>

Show all headers | View raw


In message <4df83a04$0$14668$ba4acef3@reader.news.orange.fr>
          Rick Murray <heyrickmail-usenet@yahoo.co.uk> wrote:

> On 14/06/2011 23:43, Steve Fryatt wrote:

>> SYS "Font_DecodeMenu",0,font_menu,block%,returned_name%,size3%
>> SYS "XOS_GenerateError",returned_name TO returned_name$
>                                       ^ missing % ;-)

> Erk! Hacky, using a side-effect to convert!

> You could drop the XOS_GenerateError and use something like:

>    CASE $returned_name% OF

No, that will not work. The $ operator only works for CR-terminated 
strings.

> or perhaps just specify returned_name$ in the DecodeMenu SWI to tell the
> system you want it as a string in the first place.

No, you cannot do that. Font_DecodeMenu needs a buffer pointer.

The above is a bit of a hack, but a pretty standard one for reading a 
ctrl-terminated string from memory. Better to hide that call away in a 
function and document it there, but Steve was not actually claiming 
that this is production quality code.

-- 
Martin
---------------------------------------------------------------------
Martin Wuerthner         MW Software      http://www.mw-software.com/
        RISC OS Software for Design, Printing and Publishing
---------------------------------------------------------------------

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


Thread

Font_DecodeMenu Paul Sprangers <Paul@sprie.nl> - 2011-06-14 12:24 +0200
  Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-14 15:54 +0200
    Re: Font_DecodeMenu Martin Wuerthner <spamtrap@mw-software.com> - 2011-06-14 20:52 +0200
    Re: Font_DecodeMenu Paul Sprangers <Paul@sprie.nl> - 2011-06-14 23:56 +0200
  Re: Font_DecodeMenu Steve Fryatt <news@stevefryatt.org.uk> - 2011-06-14 22:43 +0100
    Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-15 06:50 +0200
      Re: Font_DecodeMenu Martin Wuerthner <spamtrap@mw-software.com> - 2011-06-15 13:18 +0200
        Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-15 15:38 +0200
          Re: Font_DecodeMenu Steve Drain <steve@kappa.me.uk> - 2011-06-15 17:20 +0100
      Re: Font_DecodeMenu Steve Fryatt <news@stevefryatt.org.uk> - 2011-06-15 20:24 +0100
        Re: Font_DecodeMenu "Ste (news)" <steve@revi11.plus.com> - 2011-06-15 21:19 +0100
          Re: Font_DecodeMenu Steve Fryatt <news@stevefryatt.org.uk> - 2011-06-15 22:14 +0100
            Re: Font_DecodeMenu "Ste (news)" <steve@revi11.plus.com> - 2011-06-16 14:35 +0100
              Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-16 18:10 +0200
          Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-16 18:04 +0200
            Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-16 18:51 +0200
            Re: Font_DecodeMenu "Ste (news)" <steve@revi11.plus.com> - 2011-06-16 18:12 +0100
              Re: Font_DecodeMenu John Tytgat <this@is.invalid> - 2011-06-21 19:19 +0200
                Re: Font_DecodeMenu Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-22 19:18 +0200
                Re: Font_DecodeMenu "Ste (news)" <steve@revi11.plus.com> - 2011-06-25 17:53 +0100
                Re: Font_DecodeMenu John Tytgat <this@is.invalid> - 2011-06-27 13:06 +0200
        Re: Font_DecodeMenu Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> - 2011-06-15 22:13 +0100

csiph-web