Search the Community
Showing results for tags 'most efficient way?'.
-
hello world. so im trying to build something that searches a SQLite database. there are multiple search fields and i'd like to support the sql wild card "%" the method im using is making this very very long - probably can be done much shorter/efficient if $field1 <> "" and $field2 = "" and $field3 = "" and $field4 = "" then _SQLite_QuerySingleRow(-1, "SELECT field2,field3,field4 WHERE field1='" & $field1_input & "'", $aRow) endif that in itself will take several lines considering all the combinations and even more so when I consider the wildcards which changes the conditions AND sqlquery also (LIKE "%field_input") there's gotta be an efficient way to do this... thanks in advance
-
i am trying to pull the members of group A. sometimes group A has a nested group B in as a member. this sometimes carries onto several nested groups *bleh*. i am trying to build an array of members and which parent group they belong to. i am trying to find the most efficient way of doing this... here's what I have so far but this only handles up to 3 nested groups. problem is im finding some groups have more than a few nested groups! hope this makes sense.. appreciate the help! For $y = 0 To UBound($members) - 1 ;a list of memebers from Group A If $members[$y] = "" Then ContinueLoop $member_count += 1 If StringInStr($members[$y], "@") = 0 And StringInStr($members[$y], "CN=") = 0 Then ;this is how i know if the Group A member is also a group (hence referred to as Group B) $members_2 = GetGroup_Members($members[$y]) ;pulls members of nested Group B For $z = 0 To UBound($members_2) - 1 If $members_2[$z] = "" Then ContinueLoop $member_count += 1 If StringInStr($members_2[$z], "@") = 0 And StringInStr($members_2[$z], "CN=") = 0 Then ;again this is how i know if the Group B member is also a group (hence referred to as Group C) $members_3 = GetGroup_Members($members_2[$z]) ;pulls members of nested Group C (member of Group B) For $a = 0 To UBound($members_3) - 1 If $members_3[$a] = "" Then ContinueLoop $member_count += 1 ReDim $contacts[UBound($contacts) + 1][3] $contacts[UBound($contacts) - 1][0] = $group_name $contacts[UBound($contacts) - 1][1] = $members_3[$a] $contacts[UBound($contacts) - 1][2] = "PUBLIC_GROUP" Next Else ReDim $contacts[UBound($contacts) + 1][3] $contacts[UBound($contacts) - 1][0] = $group_name $contacts[UBound($contacts) - 1][1] = $members_2[$z] $contacts[UBound($contacts) - 1][2] = "PUBLIC_GROUP" EndIf Next Else ReDim $contacts[UBound($contacts) + 1][3] $contacts[UBound($contacts) - 1][0] = $group_name $contacts[UBound($contacts) - 1][1] = $members[$y] $contacts[UBound($contacts) - 1][2] = "PUBLIC_GROUP" EndIf Next