For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic DirectX > January 2005 > passing an array to a activex controll









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author passing an array to a activex controll
Joseph Balla

2005-01-23, 9:04 pm


need to reduce these calls to one
the only way I can do that is if I can repalce all of the if
statement with one

the way I was thinking is if there is a way to pass then
ColType(rr) to the cbx. controll
ie: cbx.Get {Colype(rr)} FieldbyName(h, ColName(rr), 0,
rcode)

the code listed belove I guess might give an idea of what the current code
is doing but I would like o lessen the process
any help would be nice...

If ColType(rr) = "string" Then gdf =
cbx.GetStringFieldbyName(h, ColName(rr), 0, rcode)
If ColType(rr) = "char" Then gdf = cbx.GetCharFieldbyName(h,
ColName(rr), 0, rcode)
If ColType(rr) = "integer" Then gdf =
cbx.GetIntegerFieldbyName(h, ColName(rr), 0, rcode)
If ColType(rr) = "long" Then gdf = cbx.GetLongFieldbyName(h,
ColName(rr), 0, rcode)
If ColType(rr) = "real" Then gdf = cbx.GetRealFieldbyName(h,
ColName(rr), 0, rcode)
If ColType(rr) = "money" Then gdf =
cbx.GetMoneyFieldbyName(h, ColName(rr), 0, rcode)
If ColType(rr) = "date" Then gdf = cbx.GetDateFieldbyName(h,
ColName(rr), 0, rcode)
If ColType(rr) = "time" Then gdf = cbx.GetTimeFieldbyName(h,
ColName(rr), 0, rcode)
If ColType(rr) = "boolean" Then gdf =
cbx.GetBooleanFieldbyName(h, ColName(rr), 0, rcode)




thnx...



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com