What does the keyword Set actually do in VBA?

前端 未结 7 2421
既然无缘
既然无缘 2020-11-22 04:26

Hopefully an easy question, but I\'d quite like a technical answer to this!

What\'s the difference between:

i = 4

and



        
7条回答
  •  一生所求
    2020-11-22 05:00

    set is used to assign a reference to an object. The C equivalent would be

     int i;
    int* ref_i;
    
    i = 4; // Assigning a value (in VBA: i = 4)
    ref_i = &i; //assigning a reference (in VBA: set ref_i = i)
    

提交回复
热议问题