What does DIM stand for in Visual Basic and BASIC?

后端 未结 10 2078
忘掉有多难
忘掉有多难 2020-11-30 20:39

What does DIM stand for in Visual Basic?

相关标签:
10条回答
  • 2020-11-30 21:13

    Variable declaration. Initially, it was short for "dimension", which is not a term that is used in programming (outside of this specific keyword) to any significant degree.

    http://in.answers.yahoo.com/question/index?qid=20090310095555AANmiAZ

    0 讨论(0)
  • 2020-11-30 21:14

    It's short for Dimension, as it was originally used in BASIC to specify the size of arrays.

    DIM — (short for dimension) define the size of arrays

    Ref: http://en.wikipedia.org/wiki/Dartmouth_BASIC

    A part of the original BASIC compiler source code, where it would jump when finding a DIM command, in which you can clearly see the original intention for the keyword:

    DIM    LDA XR01             BACK OFF OBJECT POINTER
           SUB N3
           STA RX01
           LDA L        2       GET VARIABLE TO BE DIMENSIONED
           STA 3
           LDA S        3
           CAB N36              CHECK FOR $ ARRAY
           BRU *+7              NOT $
           ...
    

    Ref: http://dtss.dartmouth.edu/scans/BASIC/BASIC%20Compiler.pdf

    Later on it came to be used to declare all kinds of variables, when the possibility to specify the type for variables was added in more recent implementations.

    0 讨论(0)
  • 2020-11-30 21:15

    Dim originally (in BASIC) stood for Dimension, as it was used to define the dimensions of an array.

    (The original implementation of BASIC was Dartmouth BASIC, which descended from FORTRAN, where DIMENSION is spelled out.)

    Nowadays, Dim is used to define any variable, not just arrays, so its meaning is not intuitive anymore.

    0 讨论(0)
  • 2020-11-30 21:15

    DIM stands for Declaration In Memory DIM x As New Integer creates a space in memory where the variable x is stored

    0 讨论(0)
提交回复
热议问题