03-06-2005, 01:21 PM
Quote:They return the pointer to string's data, i dunno what you mean by "string contents".
Code:dim p as byte ptr
s$ = "abc"
p = strptr( s$ )
for i = 1 to len( s$ )
print chr$(*p);
p += 1
next i
In your example s$ string len is known because it's static. While in the above DLL mode, it's only receiving pointer to the string without know len. It may called dynamics string pointer received by FB DLL.
For example if in this situation where unkown string length received by a function in Rapid-Q, Varptr$ keyword can be used to retrieve it's lenght and fill the calling variable with the string. I dunno what is behind that keyword, probably it recognized the string lenght with chr$(0) delimeter.
What I'm trying to find is the keyword that does similar with Rapid-Q VarPtr$. If I use sadd() and strptr(), the print routine only show the string address not the string itself. If I use Byte ptr, how do I know the string lenght from an adrress?
Sterling Christensen, it does not matter if the string is placed in an array of byte like in C, the important point for coder is to find the point of strings arrays end. If array, how to fetch the ubound() of the array. I think this is problem for diakin getting the DLL work with Rapid-Q. It is because the DLL routine is not completed due to in-proper string management to allow it being printed to screen with the exact string lenght or as a whole.
If we know the string lenght from give string address, the above byte ptr loop can be used to transfer string value to a variable$.