473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Question about declaring arrays

What's the difference between:

dim ipad as IPAddress()

and

dim ipad() as IPAddress

They both seem to work the same. Thanks!
Nov 21 '05 #1
4 866
Terry,

"Terry Olsen" <to******@hotmail.com>
..
What's the difference between:

dim ipad as IPAddress()

and

dim ipad() as IPAddress


Nothing

Although
dim ipad as IPAdrres(100) does not go and
dim ipad(100) as IPAdress goes.

I hope this answers your questions

Cor
Nov 21 '05 #2
Nak
Hi Cor,
Nothing


I've often wondered that too, glad you cleared that one up! :-)

Nick.
Nov 21 '05 #3
I was surprised to find that this worked also...
Dim ipad As IPAddress = Dns.ResolveToAddresses(Dns.GetHostName)(0)

That 0 at the end returns the first IPAddress in the list.

"Nak" <a@a.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi Cor,
Nothing


I've often wondered that too, glad you cleared that one up! :-)

Nick.

Nov 21 '05 #4
On 2004-11-25, Terry Olsen <to******@hotmail.com> wrote:
I was surprised to find that this worked also...
Dim ipad As IPAddress = Dns.ResolveToAddresses(Dns.GetHostName)(0)

That 0 at the end returns the first IPAddress in the list.


Dns.ResolveToAddress returns an array object - and that happens before
the assignment. This worked in VB6 as well (of course, not the Dns.*,
but the returning the element with the subscript)

--
Tom Shelton [MVP]
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: 2mc | last post by:
Generally speaking, if one had a list (from regular Python) and an array (from Numerical Python) that contained the same number of elements, would a While loop or a For loop process them at the...
35
by: David Cleaver | last post by:
Hello all, I was wondering if there were some sort of limitations on the "if" statement? I'm writing a program which needs to check a bunch of conditions all at the same time (basically). And...
28
by: Wonder | last post by:
Hello, I'm confused by the pointer definition such as int *(p); It seems if the parenthesis close p, it defines only 3 integers. The star is just useless. It can be showed by my program: ...
12
by: junky_fellow | last post by:
How can I declare a function that returns a pointer to one dimensional array ?
10
by: Kishor | last post by:
Hi, I am looking for the solution to my problem. this is related to inheritance (Inheriting properties of base class in multiple quantity) . I am writing code in VB.net language, I am having two...
9
by: NewInTheGame | last post by:
I'm a beginner in VB.Net. I'm actually taking a class & so far I understand everything, but I suck when it comes to arrays. I'm sure that this is simple (I'm ashamed of asking :oops: )... I...
3
by: Mike Cain | last post by:
I have an odd situation I'm trying to understand..... I'm using MS VS 7.0 C++ with the MFC CBuffer class. If I do this: #define NUM_ELEMENTS 2 CBuffer<char, 512 x; CBuffer<char, 512 ...
13
by: sathyashrayan | last post by:
Dear group, pls go through the following function definition: function at_show_aux(parent, child) { var p = document.getElementById(parent); var c = document.getElementById(child); var top ...
9
by: Learner | last post by:
Hello , I am kinda new to VB 6.0. Is the line of code Private strCol(62, 2) As String declares a three dimensional array? Because in the code it is being used as strCol(1,0) = "x" strCol(2,0...
5
by: Rahul B | last post by:
Hi, I have very little knowledge about creating Procedures/functions in DB2. When i tried to create the test function like CREATE FUNCTION GET_TEST (P_TEST_ID INTEGER, P_SEL_OR_SORT...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.