Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Meenachi Suppiah   on Dec 09 In MS Office Category.

  
Question Answered By: Sam Evans   on Dec 09

In some computer programming languages it is possible to
place variable names inside quotes and have the language
interpreter interpolate the value. Perl scalar variables, for
example start with a "$".

This prints "1:220" (without the quotes) in Perl.

my $p = 220;
print "1:$p";


In VBA, variable names do not have a sigil (like $ or @)
in front of them. It is more difficult to interpolate variables
inside quotes when variable names look like common words. The
VBA language writers decided that they would avoid confusion
by not interpolating variable names.

If they had not decided this, we would have problems
printing this.

Dim p as Integer
p = 220
Debug.Print " Have a Happy Day!"

With interpolation this would print the following in the
immediate window.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on What's wrong with this? Or get search suggestion and latest updates.


Tagged: