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

Color parameter as optional in a function

I need to set a parameter for a function as optional and color... how can I
do that, because seems I cant set structure as optional parameter

--
Cheers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------
Nov 20 '05 #1
3 3300
You could use a ParamArray or you could use

Sub ThisSub( y As Integer, Optional y As String = "Default Value")
MessageBox.Show("DA is: " & Y)
End Sub
Regards - OHM

Crirus wrote:
I need to set a parameter for a function as optional and color... how
can I do that, because seems I cant set structure as optional
parameter


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2
Or you could overload the function definition.

Public function thisFunc(x as string, y as integer, z as structure)

end func

Public function thisFunc(x as string, y as integer)

end func

Rigga.

"Crirus" <Cr****@datagroup.ro> wrote in message
news:ew**************@TK2MSFTNGP09.phx.gbl...
I need to set a parameter for a function as optional and color... how can I do that, because seems I cant set structure as optional parameter

--
Cheers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

Nov 20 '05 #3
"Crirus" <Cr****@datagroup.ro> schrieb
I need to set a parameter for a function as optional and color...
not possible
how
can I do that,
not at all...
because seems I cant set structure as optional
parameter


....for this reason
Overload the procedure:
sub test()
end usb

sub test(byval c as color)
end sub
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

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

Similar topics

1
by: Adam Dyga | last post by:
Hi, How to create function with optional parameter passed by reference? I've tried sth like this: function (&$param=NULL) // or: function (&$param=new array()) { //... }
5
by: John T | last post by:
I am trying to make a function that takes an optional parameter that gets passed by reference. Here is the first line of my function definition: function funQueryDatabase($strQuery,...
1
by: Learning SQL Server | last post by:
What should the default value for an optional Date parameter be in a function if I want it to default to Nothing? Setting the optional value to "" fails, so does setting it to Nothing. ...
10
by: John Morgan | last post by:
Does anyone know what parameter should be used instead of Date = 0 for the optional parameter in the following function? Public Function dhAge(ByVal dtmBD As Date, Optional ByVal dtmDate As Date...
3
by: Ronald S. Cook | last post by:
I have a function in which I'm trying to make the parameter optional. However, when I put Optional in front of ByVal below I get the error "optional parameters cannot have structure types". ...
2
by: Ronald S. Cook | last post by:
In my service project I have this function: Public Function SelectPenTypeTest(Optional ByVal PenTypeID As String = Nothing) As String Implements IPen.SelectPenTypeTest If PenTypeID =...
9
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'll ask, how do you do it? -- (i''ll be asking a lot of these, but I find C# totally way cooler than vb and there''s no go''n back!!!) thanks (as always) kes
1
by: KayC | last post by:
Hi I am using Access2002 I have a form with 5 text boxes which are parameters to a function 3 parameters are optional in the function How do I pass the empty textbox values to a optional...
7
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.