Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ampersand in Header | Excel Discussion (Misc queries) | |||
ampersand in header | Excel Discussion (Misc queries) | |||
using ampersand in the header does not appear | Excel Discussion (Misc queries) | |||
Formula with quotes and ampersand | Excel Programming |