What does dim mean in qbasic




















Since, in the original Basic, "Dim" was already a keyword used to declare array variables, the keyword was extended to include declaring all variables.

Introducing a new keyword was avoided for multiple reasons, one of which is they didn't want to break existing programs who already used the new keyword as a variable name. Today we have more sophisticated parsing technologies and faster computers, we don't see those types of limitations. For instance, in later Basic, such as Visual Basic, a type and a variable could be the same name. It means different things in different contexts.

The more formal definition is on page numbered 37 or 41 in the PDF itself. Dim have had different meanings attributed to it. Even though, it doesn't say what does Dim stand for, it says on page Now, I got a rewarding surprise later on at page , the title for the section that describes the DIM keyword note: that is not listed in the contents says: DIM dimension of an array So, I didn't get the quote "Dim stands for Again, I didn't find an account on the subject, still I was able to find a definitive quote: Before you can use an array, you must define it in a DIM dimension statement.

NET ;. Community Bot 1 1 1 silver badge. Theraot Theraot I've heard "declare in memory" also. Also I am now going to insist to people that this is what Dim actually stands for — Jacob Stamm. Guffa Guffa k gold badges silver badges bronze badges. JoshBerke JoshBerke Robert Harvey Robert Harvey k 44 44 gold badges silver badges bronze badges.

Shoban Shoban Thornton Thornton 71 1 1 silver badge 1 1 bronze badge. MonstaP MonstaP 87 1 1 silver badge 1 1 bronze badge. AbdulAziz AbdulAziz 5, 13 13 gold badges 51 51 silver badges 75 75 bronze badges.

RBT Chandralal Chandralal 2 2 gold badges 9 9 silver badges 25 25 bronze badges. Welcome to StackOverflow and thank you for this answer, but it doesn't really expand on the numerous other answers that all give the same answer.

The Overflow Blog. Podcast Quality code is the easiest to delete. Upcoming Events. Featured on Meta. Now live: A fully responsive profile. Candidate changes in Moderator Election — review your ballot. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 12 years, 4 months ago. Active 5 months ago. Viewed k times. What does Dim stand for in Visual Basic? Improve this question. Software Engineer Nick Katsivelos Nick Katsivelos 4, 4 4 gold badges 18 18 silver badges 11 11 bronze badges.

Add a comment. Active Oldest Votes. Improve this answer. In early releases of basic the only variables that needed to be declared were arrays. The "Dim" keyword was used to set the dimensions of this array. I remember reading a gw-basic programming guide in the early 80's and I explicitly remember it explaining DIM meaning Declare In Memory.

One thing to keep in mind is that, in early language development, it was common to overload a keyword to have multiple meanings. Since, in the original Basic, "Dim" was already a keyword used to declare array variables, the keyword was extended to include declaring all variables. Introducing a new keyword was avoided for multiple reasons, one of which is they didn't want to break existing programs who already used the new keyword as a variable name.

Today we have more sophisticated parsing technologies and faster computers, we don't see those types of limitations. For instance, in later Basic, such as Visual Basic, a type and a variable could be the same name. It means different things in different contexts. The more formal definition is on page numbered 37 or 41 in the PDF itself. Dim have had different meanings attributed to it. Even though, it doesn't say what does Dim stand for, it says on page Now, I got a rewarding surprise later on at page , the title for the section that describes the DIM keyword note: that is not listed in the contents says: DIM dimension of an array So, I didn't get the quote "Dim stands for Again, I didn't find an account on the subject, still I was able to find a definitive quote: Before you can use an array, you must define it in a DIM dimension statement.

NET ;. Community Bot 1 1 1 silver badge. Theraot Theraot The Dim statement must specify bounds either for all dimensions or for no dimensions. If the array has more than one dimension, you must include commas between the parentheses to indicate the number of dimensions. You can declare a zero-length array by declaring one of the array's dimensions to be A variable that holds a zero-length array does not have the value Nothing.

Zero-length arrays are required by certain common language runtime functions. If you try to access such an array, a runtime exception occurs. For more information, see Arrays.

You can initialize the values of an array by using an array literal. For multidimensional arrays, the initialization for each separate dimension is enclosed in braces in the outer dimension. The elements are specified in row-major order. For more information about array literals, see Arrays. The following table describes the results of various combinations of specifying the data type and initializer in a Dim statement. If you specify a data type but do not specify an initializer, Visual Basic initializes the variable to the default value for its data type.

The following table shows the default initialization values. Each element of a structure is initialized as if it were a separate variable. If you declare the length of an array but do not initialize its elements, each element is initialized as if it were a separate variable.

A Static local variable has a longer lifetime than that of the procedure in which it is declared. The boundaries of the variable's lifetime depend on where the procedure is declared and whether it is Shared. You can apply attributes only to member variables, not to local variables. An attribute contributes information to the assembly's metadata, which is not meaningful for temporary storage such as local variables.

At module level, you cannot use the Static modifier to declare member variables. At procedure level, you cannot use Shared , Shadows , ReadOnly , WithEvents , or any access modifiers to declare local variables. You can specify what code can access a variable by supplying an accessmodifier. Class and module member variables outside any procedure default to private access, and structure member variables default to public access. You can adjust their access levels with the access modifiers.

You cannot use access modifiers on local variables inside a procedure. You can specify WithEvents only on member variables, not on local variables inside a procedure. If you specify WithEvents , the data type of the variable must be a specific class type, not Object. You cannot declare an array with WithEvents. For more information about events, see Events. Code outside a class, structure, or module must qualify a member variable's name with the name of that class, structure, or module.

Code outside a procedure or block cannot refer to any local variables within that procedure or block. NET Framework garbage collector disposes of managed resources without any extra coding on your part. However, you can force the disposal of a managed resource instead of waiting for the garbage collector. If a class holds onto a particularly valuable and scarce resource such as a database connection or file handle , you might not want to wait until the next garbage collection to clean up a class instance that's no longer in use.

A class may implement the IDisposable interface to provide a way to release resources before a garbage collection. A class that implements that interface exposes a Dispose method that can be called to force valuable resources to be released immediately. The Using statement automates the process of acquiring a resource, executing a set of statements, and then disposing of the resource.

However, the resource must implement the IDisposable interface. For more information, see Using Statement. The following example declares variables by using the Dim statement with various options.



0コメント

  • 1000 / 1000