Re: Adding functionality to ARM BASIC
- From: Rob Kendrick <nntp@xxxxxxxx>
- Date: Thu, 29 Jan 2009 09:23:40 +0000
On 28 Jan 2009 20:51:02 +0000
jgh@xxxxxxxxxxxxxxxxxx (Jonathan Graham Harston) wrote:
nntp@xxxxxxxx wrote:
Out of interest, what do people actually use EVAL for? The only
thing
Creating variables at run-time:
Yeah, we've done this one. There really should be a syntax for it, and
Steve has suggested one.
Reading hex values:
start%=EVAL("&"+st$)
Clearly this should be done by VAL. (It is in Brandy.)
An assembler that uses BASIC variables as labels.
equ base &100 creates a variable called "base"
movb r0,(r1)base uses EVAL to find out what "base" is
This is internal to the interpreter's workings, and an implementation
issue. Not something the user cars about.
Calculated function call:
IF key%>=&80 AND key%<&9F:A%=EVAL("FN_"+STR$~key%)
Eugh, this is horrible. Firstly, there's most likely a better way of
expressing this code, and secondly there are more elegant ways of
implementing this. (Such as first-class functions or function
pointers.)
For it's original purpose:
INPUT "Enter function to graph: "func$
...
PLOT 69,x%,EVAL(func$)
And you'd certainly want no software past a little personal script ever
doing this.
B.
.
- Follow-Ups:
- Re: Adding functionality to ARM BASIC
- From: Steve Drain
- Re: Adding functionality to ARM BASIC
- References:
- Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: malshayef
- Re: Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: malshayef
- Re: Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: Ste (news)
- Re: Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: Steve Drain
- Re: Adding functionality to ARM BASIC
- From: malshayef
- Re: Adding functionality to ARM BASIC
- From: Jonathan Graham Harston
- Re: Adding functionality to ARM BASIC
- From: malshayef
- Re: Adding functionality to ARM BASIC
- From: Steve Drain
- Re: Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: Steve Drain
- Re: Adding functionality to ARM BASIC
- From: Richard Russell
- Re: Adding functionality to ARM BASIC
- From: Rob Kendrick
- Re: Adding functionality to ARM BASIC
- From: Jonathan Graham Harston
- Adding functionality to ARM BASIC
- Prev by Date: Re: Adding functionality to ARM BASIC
- Next by Date: Re: Adding functionality to ARM BASIC
- Previous by thread: Re: Adding functionality to ARM BASIC
- Next by thread: Re: Adding functionality to ARM BASIC
- Index(es):
Relevant Pages
|
Loading