Visual Basic - Arreglo de combos

Life is soft - evento anual de software empresarial
 
Vista:

Arreglo de combos

Publicado por Nicolas (225 intervenciones) el 18/10/2004 01:08:03
hola..... ciberAmigos..
Esto es para genios.. !

Tengo tres variables var1, var2 y var3, todas tipo string y que me guardan una consulta SQL que finalmente luego de evaluadas se toman para alimentar un reporte.

Necesito que cuando var1 tenga texto y las demas esten vacias, solo se tome la llena osea var1,

Cuando var2 tenga texto y las demas vacias, solo se tome var2

Cuando var1 y var2 esten llenas y var1 vacia, se tomen las dos enlazadas, osea var1 & var2 y asi sucesivamente, que creo me salen 8 arreglos.

Como lo hago.. Con Select, pero como ???
o con if y then o sera que hay otra manera de hacerla mejor.. ??

Ayudame... !! Te lo agradezco mucho.. !!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Arreglo de combos

Publicado por Domingo (52 intervenciones) el 18/10/2004 02:10:55
Yo lo haria de la siguiente manera pondria tres variables booleanas que cuando las veriables 1,2 y 3 estuvieran llenas estas variables tomaran el valor true luego es facil localiza todas las combinaciones de dichas variables booleanas ,

Dim variableboleana1 as boolean
Dim variableboleana2 as boolean
Dim variableboleana3 as boolean

If variableboleana1 =false and variableboleana 2=false and variableboleana3=false then
condicion
If variableboleana1 =false and variableboleana 2=false and variableboleana3=true then
condicion
If variableboleana1 =false and variableboleana 2=true and variableboleana3=false then
condicion
If variableboleana1 =false and variableboleana 2=true and variableboleana3=true then
condicion
If variableboleana1 =true and variableboleana 2=true and variableboleana3=true then
condicion
If variableboleana1 =true and variableboleana 2=true and variableboleana3=false then
condicion
If variableboleana1 =true and variableboleana 2=false and variableboleana3=false then
condicion
If variableboleana1 =true and variableboleana 2=false and variableboleana3=true then
condicion
end if.........
......
Tambien podrias coger las tres variables boleanas y segun sean true o false generar 8 casos que son los que hay y hacerlo con la instruccion select case
....
Espero ayudarte aunque estoy empezando y seguro que se puede hacer mas facil.....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Gracias Domingo, lo intentare

Publicado por nicolas (225 intervenciones) el 18/10/2004 02:50:35
gracias Domingo lo intentare..!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar