How to concatenate conditions on multiple lines?

6

I am working with a legacy system and it has some IFs with many conditions, with the intention of improving the readability of the code I tried to break these conditions in several lines ..

If rs(0) = "Visualizar NF" 
  And Session("idPerfil") <> "19" 
  And Session("idPerfil") <> "10" 
Then

The above excerpt generates the following error:

Erro de compilação do Microsoft VBScript erro '800a03f9' 

'Then' esperado 

I would like to know how in ASP 3.0 we can concatenate several conditions in decision structures or repetition loops?

    
asked by anonymous 08.09.2017 / 15:30

1 answer

3

Classic ASP expects Then at the end of the same line to interpret the end of the condition, to concatenate conditions on several lines we need to use _ .

Adding the underline _ to the end of each line will be interpreted correctly.

Example:

If rs(0) = "Visualizar NF" _
  And Session("idPerfil") <> "19" _
  And Session("idPerfil") <> "10" 
Then
    
08.09.2017 / 15:30