Re: Deleting a file

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ad Rienks wrote:

> -- snip -----
>  buff = allocate_low(length(filename)+1)
>  poke(buff,filename)
>  poke(buff+length(filename),0)
> --------------------------------------------------------
>
> I was wondering if the last line should not read:
>         poke(buff + length(filename) + 1, 0)
>                                      ^^^^
> Am I right or am I right?

        I don't thinks so... give them numbers:
filename = "myfile" (length = 6)
bytes allocated: 6 + 1 = 7 bytes (lets give buff any address: 10 to 16)
poke(10,"myfile") ---> pokes bytes 10,11,12,13,14,15
poke(10+6,0) = poke(16,0) --> Which is defenitly the right offset of buff

I don't know if you understand my demostration, but if you didn't... the
original way is right, you must understand that offsets start from '0'.

Thanks anyway,
--

            ************************************
            This message sent by Daniel Berstein
            ************************************
     email: architek at geocities.com
 homepages: http://www.geocities.com/SiliconValley/Heights/9316
            http://www.cybercity.hko.net/silicon_valley/architek

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu