Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinSock Array?
Message
From
13/04/2005 09:25:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003802
Message ID:
01004123
Views:
21
>Yes, but the problem becomes how to access them after creating them. In an Array I can use a For loop to quickly iterate through all the controls to find the connection I need. If I use NewObject or AddObject, then I have to use some sort of MacroReplacement scheme to be able to iterate through each individual object. Seems a little more cumbersome...
>
>Obviously if it the "only" way then so be it, but I can't believe that there is no way to make an array of this object. Ic can be done in other languages...why not FoxPro...?

Ben,
In array you create and hold the reference to object, right? What I say is:
Instead addobject/newobject, still have your array, but this time you store full reference to object as a string. ie:
with thisform
 .AddProperty('aWinsock[5]')
 for ix=1 to 5
  lcName = "myWinsock"+padl(m.ix,3,'0')
  .NewObject(m.lcName, 'myWinSockClass', 'myWinSockClassLib')
  .aWinsock[m.ix] = "thisform."+m.lcName
 endfor
endwith
Code looping array would do soemthing like:
with evaluate(thisform.aWinsock[3])
 .SomeProperty = somevalue
 .SomeMethod()
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform