D
Danscan
I am writing a game and it takes a series of varibles from
a database (multiple tables). I want to know which would
be faster, getting recordsets as I need them or fill all
of my Types with the info and then search them for what I
need. Then at the end write all calculation back to the
Database.
Also If I have a user defined type in an array like so
Dim myUser() as MyUserT
Is there a fast way I can look up a particular value in a
field of MyUser.
For instance MyUser(i).Username
I want to find the name Jim and set I to the current
location of the name Jim within MyUser.
If I was to code it manually to search I would do this.
do while i < ubound(MyUser())
if myUser(i).username = "Jim" then
exit do
end if
i = i + 1
loop
Or as a Function
public function findValue(ArryField, StrValue, LenAry)
dim i as integer
i = 0
do while i < lenAry
if Array(i).field = strValue then
findvalue = i
exit do
end if
i = i + 1
loop
end function
Anyway to dynamicly name a field to look in for a
userdefined type. I know I can in a recordset but what
about a UserDefined Type
rsDb("User" & i) Like this.
Thanks
Dan
a database (multiple tables). I want to know which would
be faster, getting recordsets as I need them or fill all
of my Types with the info and then search them for what I
need. Then at the end write all calculation back to the
Database.
Also If I have a user defined type in an array like so
Dim myUser() as MyUserT
Is there a fast way I can look up a particular value in a
field of MyUser.
For instance MyUser(i).Username
I want to find the name Jim and set I to the current
location of the name Jim within MyUser.
If I was to code it manually to search I would do this.
do while i < ubound(MyUser())
if myUser(i).username = "Jim" then
exit do
end if
i = i + 1
loop
Or as a Function
public function findValue(ArryField, StrValue, LenAry)
dim i as integer
i = 0
do while i < lenAry
if Array(i).field = strValue then
findvalue = i
exit do
end if
i = i + 1
loop
end function
Anyway to dynamicly name a field to look in for a
userdefined type. I know I can in a recordset but what
about a UserDefined Type
rsDb("User" & i) Like this.
Thanks
Dan