Login   Register 
Receive news via our XML/RSS feed
Home | Book | Contents | Preview | Articles | Tools | Newsletters | Premium | Ask | About

Home

Book

Contents

Preview

Articles

Tools

Newsletters

Premium

Ask

About

Most Popular Articles
  • Using Secure Sockets Layer (SSL) for SQL Server 2000 Reporting Services
    Creating an SSL Certificate to ensure your confidential reports remain confidential


  •  
    Beta V Corporation
     
     
    SQL Reporting Services - Answers to your questions
     
    Author Thread: Reset variable when parameter changed
    leuk31

    Reset variable when parameter changed
    Posted: Friday, March 05, 2010 1:29 PM (GST)
    Hi,

    I've this code :

    Public Shared MyVar AS Integer=0, MyVar2 AS Integer=0
     
    Public Shared FUNCTION SetMyvar(ByVal valeur AS Integer) AS Integer
     
        IF  valeur < 48 Then
            MyVar +=1
        Else
            MyVar=MyVar
        End IF
            
        RETURN MyVar
    End FUNCTION
     
    Public Shared FUNCTION SetMyvar2(ByVal valeur2 AS Integer) AS Integer
     
        IF  valeur2 < 24 Then
            MyVar2 +=1
        Else
            MyVar2=MyVar2
        End IF
        RETURN MyVar2
    End FUNCTION

    I would like to reset them when the a parameter change.
    Where or how i can do this?
    Thanks
     

    Comments:  

    Author Thread:
    William Vaughn
    Reset variable when parameter changed
    Posted: Friday, March 05, 2010 10:07 PM (GST)

    I would create a hidden (internal) parameter that's set when the routine runs the first time. After that, if the new parameter is different than the saved parameter you know it has changed in which case you could save the new parameter in the hidden parm.

     

    hth

     
     
     
     
     
    Home | Book | Contents | Preview | Articles | Tools | Newsletters | Premium | Ask | About