[futurebasic] Re: [FB] Edit Fields, Strings

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

From: tedd <tedd@...>
Date: Fri, 21 May 1999 11:13:25 -0400
>Ted's Long Strings builds up a block of string data, and works. However,
>it returns only one character at a time, I need a pointer to the whole
>block of string data.
>(Look at line 4 of the code below, from Ted's long strings)
>  tagByte% = FN HGETSTATE(gStringH&)'get state of handle
>  osErr% = FN HLOCK(gStringH&)'lock handle
>  addr& = [gStringH&] + offSet% + 2'get the address for the btye requested
>  result% = PEEK(addr&)     'get the byte value from the address
>  osErr% = FN HSETSTATE(gStringH&,tagByte%)'return the state of the handle
>The function returns result%. I need a function which accepts characters,
>builds up the data, and when I want, can give me a pointer to the entire
>block of data. Then I'll send that pointer to the TCP/IP function. I am
>not yet good at memory/peek/handle/pointer type of things.


The variable "[gStringH&]" _is_ the handle the data block and what you
want. You have to understand the difference between handles and pointers.

The get and put character at a time in my long strings (from memory) is
only because you don't know in advance how many characters you are going to
need in your long strings. As such, I build the long string a character at
a time. If you want to build faster, then determine how many characters you
want at a time OR figure how many characters are in the buffer you receive
and then set the blockmove.


<mailto:tedd@...>	               http://sperling.com/