[futurebasic] Re: [FB] String <=> Handle

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1999 : Group Archive : Group : All Groups

From: Derek Smith <dereksmi@...>
Date: Sun, 12 Sep 1999 00:53:19 -1000
On Sat, 11 Sep 1999, Chris wrote:

> On 09/12/1999 at 02:29 AM, jktr@... (Jay Reeve)
> wrote:
> 
> > 2. As a matter of course I prefer to use
> >        POKE @theStr$,0
> > instead of 
> >       theStr$ = ""
> > because it is faster, even though that often doesn't matter.
> 
> Actually, as long as the compiler isn't moronic this would be
> exactly equivalent :) Since to zero a pascal string you set the
> first byte to zero no matter what you do, I'd be highly surprised
> to find that the compiler was doing anything different.

I just disassembled theStr$ = "" and it is exactly equivalent to Poke
@theStr$,0, except that it jumps to a subroutine to do this.  So the
direct poke statement is a little faster because there is no branch to the
runtime going on.

-Derek