Information générale
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Network:
Windows 2008 Server
>Hi All!
>
>I have a complicated If statement that I will like to convert to Select Case but the expresion that I have in the IF is a little difficult. Maybe someone already did it, let see,.
>
>If TypeOf rptVendorPayeeReport Is ExportReport Then
>some code
>else
>If TypeOf rptVendorPayeeReport Is ReportListingThen
>some code
>else
>If TypeOf rptVendorPayeeReport Is ReportListing2 Then
>
>an continue six level down.
>
>I will like to make it Select Case but that give me an error,. sound logic this way
>
>Select case TypeOf rptvendorPayeeReport is
>
>case Report listing
>
>.....
>
>end select
>
>But does not work.. Any Idea are welcome.
>
>TIA
Assuming rptVendorPayeeReport is an enumerator with values of ExportReport, ReportListing, etc., try this (and don't forget the parentheses in the switch line) ---
switch ( rptVendorPayeeReport )
{
case ExportReport :
statements
break;
case ReportListing :
statements
break;
....
default :
statements
break;
}
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement