Bharat_Naik
Senior Member Members
    Offline
 Ever ready to learn and share
Posts: 1202
Location: Chicago, Illinois
Joined: Dec 16 th, 2003
|
Re: UserSelect Question
Reply #14 - Mar 21st, 2005 at 8:42pm
|
Print Post
|
I have implemented abc.. and ..abc.. I do not see any value of ..abc if both above are working.
Global Code ______________
var vFieldName as String var vStart as String var vEnd as String
// Finds all values in vVals that contain vMatch. Returns matching // values as a semicolon separated list. Function FilterValueList(var vVals as String, vMatch as String) as String var vList as String var vItem as String vList = "" While @Len(vVals) > 0 { vItem = Split(vVals, ";") If @Instr(vItem, vMatch) > 0 { If @Len(vList) > 0 { vList = vList + ";" } vList = vList + vItem } } return(vList) End Function
var vApplication as String var vTarget as String var vDisplay as string
//For PickList
Subroutine PickList_choose( ) var vVals as String var vFinalList as String var vSearch as String
If @Right (vfieldName, 2) = ".." and @Left (vFieldName, 2) <> ".." then { vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1) vEnd = @left (vFieldName, @in (vFieldName, "..") - 1) + "zzzzzzz"
}
If @left (@(vFieldName), 2) = ".." and @Right (@(vFieldName), 2) = ".." then { vSearch = @replace (@(vFieldName), "..", "") vFinalList = "" vVals = @XListValues(vApplication, vDisplay) vFinalList = FilterValueList(vVals, vSearch) @(vFieldName) = @UserSelect(vFinalList) If @in (@(vFieldName), "/") > 0 then @(vFieldName) = @Replace (@(vFieldName), "/", "//") //writeln (@(vFieldName)) @(vFieldName) = @xlookup (vApplication, @(vFieldName), "Display1", vTarget)
}
End Subroutine
======================
Dx1 on element exit event (Dx1 is the name of element) ____________
If @left (Dx1, 2) = ".." and @right (Dx1, 2) = ".." then
{ vApplication = "data\diag.db" vTarget = "DiagCode" vDisplay = "Diag!Display1" vFieldName = "Dx1" picklist_choose ( ) }
if @Right (Dx1, 2) = ".." and @Left (Dx1, 2) <> ".." then
{ vFieldName = Dx1 picklist_choose ( ) Dx1 = @xUserselectR ("data\Diag.db", "Diag!Display", "DiagCode", vStart, vEnd) }
|