|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Copying a User-defined type arrayType blah X as String Y as String Z as String etc.... End Type Now I create an array of this type say, Dim foo(0 to 10) as blah If I have a need to re-sort the contents of the array, can I do something as simple as: foo(0) = foo(1) or do I need to physically move each variable in the type structure from one array element to the other? Thanks in advance, Eva
Show quote
Hide quote
"wxforecaster" <ebookbin***@interwarn.com> wrote in message You can do it exactly as written.news:uFEfha6JGHA.2828@TK2MSFTNGP12.phx.gbl... > Say I have a user defined type: > > Type blah > X as String > Y as String > Z as String > etc.... > End Type > > Now I create an array of this type say, > > Dim foo(0 to 10) as blah > > If I have a need to re-sort the contents of the array, can I do something > as simple as: > > foo(0) = foo(1) or do I need to physically move each variable in the type > structure from one array element to the other? > > Thanks in advance, > Eva > > > BTW, the time to check it would be almost equal to that you spent typing your request <g> Dmitriy. True true, but it's nice to know that I'm not overlooking something with a
30+ variable type cast :) Thanks for the confirmation. That saved me a lot of time. Evan Show quoteHide quote "Dmitriy Antonov" <antonovdima@netzero.net_NOT_FOR_SPAM> wrote in message news:%230wLZp6JGHA.1320@TK2MSFTNGP15.phx.gbl... > > "wxforecaster" <ebookbin***@interwarn.com> wrote in message > news:uFEfha6JGHA.2828@TK2MSFTNGP12.phx.gbl... >> Say I have a user defined type: >> >> Type blah >> X as String >> Y as String >> Z as String >> etc.... >> End Type >> >> Now I create an array of this type say, >> >> Dim foo(0 to 10) as blah >> >> If I have a need to re-sort the contents of the array, can I do something >> as simple as: >> >> foo(0) = foo(1) or do I need to physically move each variable in the type >> structure from one array element to the other? >> >> Thanks in advance, >> Eva >> >> >> > > You can do it exactly as written. > > BTW, the time to check it would be almost equal to that you spent typing > your request <g> > > Dmitriy. > "wxforecaster" <ebookbin***@interwarn.com> wrote in message If you're sorting an array of UDTs of such a size it would be very much news:%232F8QsAKGHA.524@TK2MSFTNGP09.phx.gbl... > True true, but it's nice to know that I'm not overlooking > something with a 30+ variable type cast :) faster to sort and / or swap pointers to the UDTs, rather than sorting / swapping the UDTs themselves. In such cases an index sort would be probably about twenty times faster than a straight forward sort. Mike
USB-Memorystick - serial number
Hpw to make a VB6 form appears and gets focus every 15 seconds Writing to .TXT file question Do we have such a container control? www Link in VB 6... Book for web dev with VS2005? Need help regarding the program... Please help me.. It's very Urgent missing reference Connection Recordset to FlexGrid |
|||||||||||||||||||||||