Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J S J S is offline
external usenet poster
 
Posts: 11
Default What does an ampersand mean in VBA?

I know that an ampersand is generally used as the concatenation operator but
I seemed to have found another usage of it that I don't understand. Here is
a code snippet:

Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("2:", "scott/tiger", 0&)
Set EmpDynaset = OraDatabase.DbCreateDynaset("select * from emp", 0&)

Notice the parameters 0&, what does the & do? Based on the documentation I
would have just put a zero instead of a 0&.

-J


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default What does an ampersand mean in VBA?

In this context, the & character makes the number a Long type value, rather
than an Integer.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"J S" wrote in message ...
I know that an ampersand is generally used as the concatenation operator

but
I seemed to have found another usage of it that I don't understand. Here

is
a code snippet:

Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("2:", "scott/tiger", 0&)
Set EmpDynaset = OraDatabase.DbCreateDynaset("select * from emp", 0&)

Notice the parameters 0&, what does the & do? Based on the documentation I
would have just put a zero instead of a 0&.

-J




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default What does an ampersand mean in VBA?

J S wrote:
I know that an ampersand is generally used as the concatenation operator but
I seemed to have found another usage of it that I don't understand. Here is
a code snippet:

Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("2:", "scott/tiger", 0&)
Set EmpDynaset = OraDatabase.DbCreateDynaset("select * from emp", 0&)

Notice the parameters 0&, what does the & do? Based on the documentation I
would have just put a zero instead of a 0&.


It forces the 0 to be a long instead of an integer.
This ensures that the correct type of variable is passed as the Oracle
procedure argument.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ampersand in Header SAL Excel Discussion (Misc queries) 1 April 14th 06 12:21 AM
ampersand in header EllenSeitz Excel Discussion (Misc queries) 1 February 9th 06 03:34 PM
using ampersand in the header does not appear Katydid Excel Discussion (Misc queries) 4 December 12th 05 10:24 PM
Formula with quotes and ampersand Neil[_11_] Excel Programming 3 November 10th 03 07:49 AM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"