473,411 Members | 2,031 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,411 software developers and data experts.

Whats the default value for a string()

OK simple question. Whats the default value for an string() array?

sub LoadStuff(byval one as integer, byval two as string, optional byval
three() as string = ??)

Its driving me nuts!

Thanks!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Nov 20 '05 #1
4 1985
Hi,
sub LoadStuff(byval one as integer, byval two as string,
optional byval
three() as string = ??)


It has to be Nothing, because it has to be a constant value.

Mit freundlichen Gruessen / Best regards,

--
Karsten Samaschke
IT-Consulting, IT-Development, IT-Training
5x MS MVP ASP / ASP.NET, Germany
Homepage: http://www.ksamaschke.de
Weblog: http://www.karsan.de
- - - - - - - - - - - - - - - - - - - - - - - - - -
My Weblog: http://www.karsan.de
My Books: http://books.ksamaschke.de

Nov 20 '05 #2
Thanks for Karsten's inputs.

Hi David,

As for the string() , it is actually an Array type which is a reference
type. So when we use reference type as optional parameter in VB.NET
function, we have to assign Nothing as its default value (since there is no
static expression which can represent an instance of a reference type....)

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Message-ID: <dl**********@news.ksamaschke.de>
| From: "Karsten Samaschke [MVP]" <ms****@ksamaschke.de>
| References: <uy**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: Whats the default value for a string()
| Date: Thu, 17 Nov 2005 09:46:31 +0100
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| X-Mailer: Microsoft Office Outlook, Build 11.0.6353
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| In-Reply-To: <uy**************@TK2MSFTNGP12.phx.gbl>
| thread-index: AcXrUWadNgQNceNjTjq0ZgjptJbulAAAXijQ
| X-Transport: MAPILab NNTP v1.3 for Microsoft Outlook,
http://www.mapilab.com/
| User-Agent: Hamster-Pg/1.21
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: webbox301.server-home.net 195.137.213.62
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358835
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
|
| > sub LoadStuff(byval one as integer, byval two as string,
| > optional byval
| > three() as string = ??)
|
| It has to be Nothing, because it has to be a constant value.
|
| Mit freundlichen Gruessen / Best regards,
|
| --
| Karsten Samaschke
| IT-Consulting, IT-Development, IT-Training
| 5x MS MVP ASP / ASP.NET, Germany
| Homepage: http://www.ksamaschke.de
| Weblog: http://www.karsan.de
| - - - - - - - - - - - - - - - - - - - - - - - - - -
| My Weblog: http://www.karsan.de
| My Books: http://books.ksamaschke.de
|
|

Nov 20 '05 #3
Excellent, thank you both!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:mx*************@TK2MSFTNGXA02.phx.gbl...
Thanks for Karsten's inputs.

Hi David,

As for the string() , it is actually an Array type which is a reference
type. So when we use reference type as optional parameter in VB.NET
function, we have to assign Nothing as its default value (since there is
no
static expression which can represent an instance of a reference type....)

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Message-ID: <dl**********@news.ksamaschke.de>
| From: "Karsten Samaschke [MVP]" <ms****@ksamaschke.de>
| References: <uy**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: Whats the default value for a string()
| Date: Thu, 17 Nov 2005 09:46:31 +0100
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| X-Mailer: Microsoft Office Outlook, Build 11.0.6353
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| In-Reply-To: <uy**************@TK2MSFTNGP12.phx.gbl>
| thread-index: AcXrUWadNgQNceNjTjq0ZgjptJbulAAAXijQ
| X-Transport: MAPILab NNTP v1.3 for Microsoft Outlook,
http://www.mapilab.com/
| User-Agent: Hamster-Pg/1.21
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: webbox301.server-home.net 195.137.213.62
| Lines: 1
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358835
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
|
| > sub LoadStuff(byval one as integer, byval two as string,
| > optional byval
| > three() as string = ??)
|
| It has to be Nothing, because it has to be a constant value.
|
| Mit freundlichen Gruessen / Best regards,
|
| --
| Karsten Samaschke
| IT-Consulting, IT-Development, IT-Training
| 5x MS MVP ASP / ASP.NET, Germany
| Homepage: http://www.ksamaschke.de
| Weblog: http://www.karsan.de
| - - - - - - - - - - - - - - - - - - - - - - - - - -
| My Weblog: http://www.karsan.de
| My Books: http://books.ksamaschke.de
|
|

Nov 20 '05 #4
You're welcome David,

Good luck!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "David Lozzi" <Da********@nospam.nospam>
| References: <uy**************@TK2MSFTNGP12.phx.gbl>
<dl**********@news.ksamaschke.de> <mx*************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Whats the default value for a string()
| Date: Thu, 17 Nov 2005 11:51:09 -0500
| Lines: 79
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <eH**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: c-24-63-42-200.hsd1.ma.comcast.net 24.63.42.200
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358963
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Excellent, thank you both!
|
| --
| David Lozzi
| Web Applications Developer
| dlozzi@(remove-this)delphi-ts.com
|
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:mx*************@TK2MSFTNGXA02.phx.gbl...
| > Thanks for Karsten's inputs.
| >
| > Hi David,
| >
| > As for the string() , it is actually an Array type which is a reference
| > type. So when we use reference type as optional parameter in VB.NET
| > function, we have to assign Nothing as its default value (since there
is
| > no
| > static expression which can represent an instance of a reference
type....)
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| > --------------------
| > | Message-ID: <dl**********@news.ksamaschke.de>
| > | From: "Karsten Samaschke [MVP]" <ms****@ksamaschke.de>
| > | References: <uy**************@TK2MSFTNGP12.phx.gbl>
| > | Subject: Re: Whats the default value for a string()
| > | Date: Thu, 17 Nov 2005 09:46:31 +0100
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="us-ascii"
| > | Content-Transfer-Encoding: 7bit
| > | X-Mailer: Microsoft Office Outlook, Build 11.0.6353
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | In-Reply-To: <uy**************@TK2MSFTNGP12.phx.gbl>
| > | thread-index: AcXrUWadNgQNceNjTjq0ZgjptJbulAAAXijQ
| > | X-Transport: MAPILab NNTP v1.3 for Microsoft Outlook,
| > http://www.mapilab.com/
| > | User-Agent: Hamster-Pg/1.21
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: webbox301.server-home.net 195.137.213.62
| > | Lines: 1
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:358835
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hi,
| > |
| > | > sub LoadStuff(byval one as integer, byval two as string,
| > | > optional byval
| > | > three() as string = ??)
| > |
| > | It has to be Nothing, because it has to be a constant value.
| > |
| > | Mit freundlichen Gruessen / Best regards,
| > |
| > | --
| > | Karsten Samaschke
| > | IT-Consulting, IT-Development, IT-Training
| > | 5x MS MVP ASP / ASP.NET, Germany
| > | Homepage: http://www.ksamaschke.de
| > | Weblog: http://www.karsan.de
| > | - - - - - - - - - - - - - - - - - - - - - - - - - -
| > | My Weblog: http://www.karsan.de
| > | My Books: http://books.ksamaschke.de
| > |
| > |
| >
|
|
|

Nov 20 '05 #5

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

Similar topics

43
by: Mr.Tickle | last post by:
// Run this code and look for his obvious error by the compiler namespace FlagCheck { using System; enum SomeFlags {
2
by: Benny Pedersen | last post by:
<head><title>Test</title> <style>body{font-Family="courier new";} </style> <script language="javaScript"> function changeTxt() { document.getElementById("b").style.fontFamily="Verdana";...
1
by: aa | last post by:
When I am reading from local disk (d:), everithing is OK, but then I am reading from map disk I am geting the this error. Whats wrong. Thanks Server Error in '/Extra' Application....
8
by: buc | last post by:
I have a simple combox on the screen that is bound via a datareader to a stored proc in sql that returns a simple string. The code is 'load stored proc then dReader =...
4
by: sophie | last post by:
Whats going on here: Read in a number as a string: scanf("%s", &number); number = 12345, for arguements sake Print it like this its fine:
20
by: Snis Pilbor | last post by:
Whats the point of making functions which take arguments of a form like "const char *x"? It appears that this has no effect on the function actually working and doing its job, ie, if the function...
2
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40)....
10
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under...
7
by: Rohit | last post by:
Hi, I am working on a switch module which after reading voltage through a port pin and caterogizing it into three ranges(open,low or high), passes this range to a function switch_status() with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.