Debugging Variables Made Easy

Debugging Variables Made Easy

At one time or another, all ASP progrmmers have used RESPONSE.WRITE to write out a variable on the screen, ensuring that the variable is passing correctly or has the correct value. Then, when the page goes live, you have to go back and comment out or delete all those RESPONSE.WRITEs.

I have found a way to display your variables with only one line change.

At the top of your ASP page add the following line:

 CONST DEBUG_MODE = False

Then, anywhere you need to display a variable, add.

 If DEBUG_MODE then  RESPONSE.WRITE "MyVar = " & MyVar & "
" ' add more if neededEnd If

The Above code says If DEBUG_MODE is TRUE then display “MyVar” (change MYVAR to the name of your variable). Whenever you want to show your variables, go back to the top of the page and set DEBUG_MODE to True:

 CONST DEBUG_MODE = True

Save the page and reload it in the browser. Your variables will be displayed. Once you’re done debugging, set DEBUG_MODE back to False and be done with it.

Hope this tip helps someone. Please give feedback to [email protected].

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as