France,
Toulouse,
Thursday, May, 4th, 2006,
12:25 pm.
Hi,
I confirm.
The general idea is:
- declare (Dim) a TCPSocket array (since ActiveConnections() returns an
array of TCPSocket),
- cast element of this array.
REALbasic don't like type casting on array. You cannot cast an entire array.
It's possible to type cast non array variable only. Only element of an array
can be type casted. It's a rule on thumb to keep in mind.
Best Regards,
Nils
----
Le 4/05/06 8:58, « [NOM] » <[ADRESSE]> a écrit :
> ActiveConnections returns an array of TCPSocket, so your aTCPSocketArray
> must be:
>
> dim aTCPSocketarray() as TCPSocket
>
> Then you can cast an individual element of the array as JBE_TCPSocket:
>
> aTCPSocketarray= JBE_ServerSocket1.ActiveConnections
> JBE_TCPSocket(aTCPSocketarray(x)).SocketID= y
>
> Jim meant to say "dim ac() as TCPSocket". Slip of the fingers.
>
> hth,
> Tim
>
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] Behalf Of Jeff
>> Edwards
>> Sent: Wednesday, May 03, 2006 7:36 PM
>> To: REALbasic NUG
>> Subject: Re: assigning a property of a subsclass from tcpsocket
>>
>>
>> Hi Jim,
>>
>> I think I tried that but had not success:
>>
>> dim aTCPsocketarray() as JBE_TCPSocket
>> aTCPsocketarray = JBE_ServerSocket1.ActiveConnections
>>
>> The second line will give me a type mismatch error, but yes a
>> typecast is exactly what I would like to be able to do. Is this
>> possible in Realbasic?
>>
>> On 04/05/2006, at 10:22 AM, Jim Dossey wrote:
>>
>>> Since nobody else has replied I'll take a shot at it.
>>>
>>> My guess is that you need to cast the value returned from
>>> JBE_ServerSocket1.ActiveConnections to a JBE_TCPSocket. I'm not
>>> sure how
>>> you do that with an array, but you can try something like this
>>>
>>> Dim ac() As JBE_TCPSocket
>>> ac = JBE_ServerSocket.ActiveConnections
>>> JBE_TCPSocket(ac(x)).SocketID = y
>>>
----
Nils Frisch
http://www.nils-frisch.com/
Toulouse,
France.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>