Hello Experts
See My Code - Private sub F_Clear(Paramarray Cntr())
-
dim i%
-
For i=0 to ubound(cntr)
-
cntr(i).text = ""
-
next
-
End sub
In this procedure when I call this error is coming
Any Bugs in the code
Error is
F_Clear (TxtBox(0),TxtBox(2))
Compile Error
Expected: =
14 2316 kadghar 1,295
Recognized Expert Top Contributor
Hello Experts
See My Code
Private sub F_Clear(Paramarray Cntr())
dim i%
For i=0 to ubound(cntr)
cntr(i).text = ""
next
End sub
F_Clear (TxtBox(0),TxtBox(2))
Compile Error
Expected: =
I dont know what the problem might be. I tried it using two textboxes, and it cleared them without any problem. May be your textboxes have some issues.
btw, i liked your avatar.
HTH
Hello Kadghar
Thanx For Reply
Hw u try
Plz Give me
textboxe have wat pblm occure, if it is one then no prob
also Give u r trying code
I will
Faisal
I dont know what the problem might be. I tried it using two textboxes, and it cleared them without any problem. May be your textboxes have some issues.
btw, i liked your avatar.
HTH
kadghar 1,295
Recognized Expert Top Contributor
Hello Kadghar
Thanx For Reply
Hw u try
Plz Give me
textboxe have wat pblm occure, if it is one then no prob
also Give u r trying code
I will
Faisal
i created a new form with two textboxes : textbox1 and textbox2, then i copy pasted your sub, and in the click event of the form i called it: - Private Sub F_Clear(ParamArray Cntr())
-
Dim i%
-
For i = 0 To UBound(Cntr)
-
Cntr(i).Text = ""
-
Next
-
End Sub
-
-
Private Sub UserForm_Click()
-
Call F_Clear(TextBox1, TextBox2)
-
End Sub
then i run it, write something in each textbox and when i click on the form it clears both textboxes.
HTH
Hello Kadghar
Thanx For
It is wat is Usage of Using call Before Procedure
I mean
Call F_Clear(textbox1)
i just Call as
F_Clear(textbox1)
When use call Bfore that it working
Reply if u can
Faisal
i created a new form with two textboxes : textbox1 and textbox2, then i copy pasted your sub, and in the click event of the form i called it: - Private Sub F_Clear(ParamArray Cntr())
-
Dim i%
-
For i = 0 To UBound(Cntr)
-
Cntr(i).Text = ""
-
Next
-
End Sub
-
-
Private Sub UserForm_Click()
-
Call F_Clear(TextBox1, TextBox2)
-
End Sub
then i run it, write something in each textbox and when i click on the form it clears both textboxes.
HTH
Hi guy'z the only thing differ between kadghar codes and mafaisal codes is that kadghar - Call F_Clear(TextBox1, TextBox2)
mfaisal - F_Clear (TxtBox(0),TxtBox(2))
-- Kenneth
"Better Than Yesterday"
Hello
Yes I Know, When Use Call that work
My Question is Wat is the importants of Using Call...?
Faisal
Hi guy'z the only thing differ between kadghar codes and mafaisal codes is that kadghar - Call F_Clear(TextBox1, TextBox2)
mfaisal - F_Clear (TxtBox(0),TxtBox(2))
-- Kenneth
"Better Than Yesterday"
kadghar 1,295
Recognized Expert Top Contributor
Hello
Yes I Know, When Use Call that work
My Question is Wat is the importants of Using Call...?
Faisal
I dont know. I thought it was the same using it or not.
I have that "bad habit" of using it, but... seems that it solved the problem this time.
There was a short discussion in this forum about using Call a few weeks ago, i'll see if i find it to ask why this is happening to some Expert...
Ô_o (wait... )
kadghar 1,295
Recognized Expert Top Contributor
This might help you Importance of Call
-- Kenneth
"Better Than Yesterday"
I see... but they say you can use it for calling functions if you dont care about the return value. but... this is not a function!!!!
=( this time i have no idea why this is happening, i'll google some similar situations.
K, Thanx
So It Concluded That
Using of Call is Good Practice
Usually i did not use Call
K
Faisal
This might help you Importance of Call
-- Kenneth
"Better Than Yesterday"
K, Thanx
So It Concluded That
Using of Call is Good Practice
Usually i did not use Call
K
Faisal
Yes! it is easier to identify codes.. you should start practicing it
I've never used a ParamArray, so this might be incorrect. But my immediate response is that instead of F_Clear (TxtBox(0),TxtBox(2))
you should try F_Clear TxtBox(0), TxtBox(2)
Yes! it is easier to identify codes.. you should start practicing it
Absolute rubbish! With the possible exception of a ParamArray (don't know yet) there's no reason to use Call.
EDIT: No, I've tried it, and the ParamArray has no effect. You don't need the Call either way. Just leave off the extra parentheses.
kadghar 1,295
Recognized Expert Top Contributor
I've never used a ParamArray, so this might be incorrect. But my immediate response is that instead of F_Clear (TxtBox(0),TxtBox(2))
you should try F_Clear TxtBox(0), TxtBox(2)
Not incorrect at all, it worked great.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tom |
last post by:
Hi everyone
In VB6,paramarray parameter is passed using byref,but in VB.NET,using byval.How can I get back the changed value of the paramarray parameter
My work case in vb.net like this...
|
by: Cort |
last post by:
I have a project that I am trying to upgrade that uses VB6 components and ASP. I have gotten to the point when I have been able to upgrade the project to VB.NET, compile and register it for use by...
|
by: Edlueze |
last post by:
Greetings:
I have two functions and I would like to pass the ParamArray gathered
from one function to the other function. For the purposes of this post,
let's say that they are calculating...
|
by: Bruno Miousse |
last post by:
I am trying to invoke a COM component (written in VB6) which accepts
parameter of ParamArray data type.
What would be the proper syntax in C# for passing ParamArray in VB6?
Thanks.
|
by: Tubs |
last post by:
I know it might seem weird but i have a need to pass the contents of a
paramarray from one sub to another that also takes a paramarray.
Problem is i want to pass it exactly as it came in to the...
| |
by: Peter |
last post by:
Hi everyone
In VB6,paramarray parameter is passed using byref,but in VB.NET,using byval.How can I get back the changed value of the paramarray parameter
My work case in vb.net like this...
|
by: djpirra |
last post by:
Hi,
I managed to create a Shared Add-in in Vs.net 2003 and create all the
menus,
UDFS and all that....
The only 2 problems i am having now are:
1 - The formulas seems to work only at second...
|
by: ADezii |
last post by:
Generally, the number of Arguments in a Procedure Call must be the same as in the Procedure Specification. If a Procedure requires 3 Arguments in its Specification, when calling the Procedure you...
|
by: mafaisal |
last post by:
End of parameter list expected. Cannot define parameters after a paramarray parameter.
Public Sub F_Bind(ByVal StrSql As String, ByVal ParamArray Ctrls() As Object,Optional ByVal Row as Integer...
|
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,...
|
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...
| |
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,...
|
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...
|
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,...
|
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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |