#: 20498 S1/General Interest
29-Oct-94 11:20:03
Sb: #20490-Any suggestions?
Fm: David Breeding 72330,2051
To: Dick Watson 71320,2340
> >>Perhaps you could use the SIZE(str) function.
>
> Well, I was really looking for simple IPC mechanisms and one of them was
> to find a way to pass a pointer to a string. This would mean I'd also have
> to pass SIZE(str). Maybe this elegant IPC stuff is just too much under
> the circumstances.
Well, maybe this will work. If you have a Basic main prog, say Prog1, as
follows:
Dim s1:string[50]
RUN Prog2(s1)
Then you have prog2 :
DIM s2:string[100]
Print "The size of the string: ";size(s2)
Then the correct size WILL be passed PROVIDED the stringsize in the subfunction
is >= the stringsize in the calling function.. Note if it is smaller, SIZE(s2)
will return a Parameter Error.
Hopefully this might help you.. However, you might need to ensure that the s2
IS >= s1. Otherwise, everything will be OK if LEN() of the passed string is <
SIZE(s2), but if the passed strlen exceeds the capacity of the PARAM string,
then PARAM ERROR is returned.
-- David Breeding --
CompuServe : 72330,2051
Delphi : DBREEDING
*** Sent via CoCo-InfoXpress V1.01 ***
^^^^ ^^^^^^^^^^
|