---
title: "What Is The Difference Between the Dim, Public, and Private Statements?"  
description: "What Is The Difference Between the Dim, Public, and Private Statements?"  
author: "Dependra Pathak"  
published: 2011-03-19  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/561/what-is-the-difference-between-the-dim-public-and-private-statements  
category: "vb script"  
tags: ["vb script"]  
reading_time: 1 minute  

---

# What Is The Difference Between the Dim, Public, and Private Statements?

Private statement variables are available only to the script in which they are declared.\
Public statement variables are available to all procedures in all scripts.\
Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.\

## Answers

### Answer by Dependra Pathak

Private statement variables are available only to the script in which they are declared.\
Public statement variables are available to all procedures in all scripts.\
Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.\


---

Original Source: https://www.mindstick.com/interview/561/what-is-the-difference-between-the-dim-public-and-private-statements

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
