473,799 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Can't use parentheses when calling a Sub" help......


<script type="text/vbscript">
sub setTextBoxValue (a1,a2)
thedelete.delet eTextBox.value = a1

end sub
</script>

<td>
<a href="#"
onclick="setTex tBoxValue('<%#C ontainer.DataIt em("SerialNumbe r")%>','<%#Cont ainer.DataItem( "EquipmentCateg ory")%>')">
<%#Container.Da taItem("SerialN umber")%> </a>
</td>
when i click on <%#Container.Da taItem("Equipme ntCategory")%>' )
then it will call sub setTextBoxValue (a1,a2) function

but it return "Can't use parentheses when calling a Sub"
may i know what is the problem??
i can create a function that more than 1 variable??
or my database connection or variable got problem??
help...

May 6 '06 #1
7 5239
JT
This may not apply here, but in straight ASP (not ASP.NET), if you have
a function such as GimmeWhatIWant( Bribes, Groupies), then in your code
you need to call it with the following statement:

call GimmeWhatIWant( 500.00, "Suzie")

If you don't include the word "call " then you will get that
"parenthese s" error. Again, that may not be applicable here, but I
hope that helps.

May 6 '06 #2
Does it work if you do as it says and remove the brackets?

<a href="#"
onclick="setTex tBoxValue
'<%#Container.D ataItem("Serial Number")%>','<% #Container.Data Item("Equipment Category")%>'">
<%#Container.Da taItem("SerialN umber")%> </a>
See

http://msdn.microsoft.com/library/de...499137b3f7.asp

"To call a Sub procedure from another procedure, type the name of the
procedure along with values for any required arguments, each separated by a
comma. The Call statement is not required, but if you do use it, you must
enclose any arguments in parentheses.

The following example shows two calls to the MyProc procedure. One uses the
Call statement in the code; the other doesn't. Both do exactly the same
thing. "

Call MyProc(firstarg , secondarg)

MyProc firstarg, secondarg


<zh*****@gmail. com> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com...

<script type="text/vbscript">
sub setTextBoxValue (a1,a2)
thedelete.delet eTextBox.value = a1

end sub
</script>

<td>
<a href="#"
onclick="setTex tBoxValue('<%#C ontainer.DataIt em("SerialNumbe r")%>','<%#Cont ainer.DataItem( "EquipmentCateg ory")%>')">
<%#Container.Da taItem("SerialN umber")%> </a>
</td>
when i click on <%#Container.Da taItem("Equipme ntCategory")%>' )
then it will call sub setTextBoxValue (a1,a2) function

but it return "Can't use parentheses when calling a Sub"
may i know what is the problem??
i can create a function that more than 1 variable??
or my database connection or variable got problem??
help...

May 6 '06 #3
if i put like this...
<a href="#" onclick=Call
"setTextBoxValu e('<%#Container .DataItem("Seri alNumber")%>')" >
<%#Container.Da taItem("SerialN umber")%> </a>

return error msg:syntax error

May 7 '06 #4
What about turning the sub into a function?

<script type="text/vbscript">
function setTextBoxValue (a1,a2)
thedelete.delet eTextBox.value = a1
end function
</script>

<zh*****@gmail. com> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com...

<script type="text/vbscript">
sub setTextBoxValue (a1,a2)
thedelete.delet eTextBox.value = a1

end sub
</script>

<td>
<a href="#"
onclick="setTex tBoxValue('<%#C ontainer.DataIt em("SerialNumbe r")%>','<%#Cont ainer.DataItem( "EquipmentCateg ory")%>')">
<%#Container.Da taItem("SerialN umber")%> </a>
</td>
when i click on <%#Container.Da taItem("Equipme ntCategory")%>' )
then it will call sub setTextBoxValue (a1,a2) function

but it return "Can't use parentheses when calling a Sub"
may i know what is the problem??
i can create a function that more than 1 variable??
or my database connection or variable got problem??
help...

May 7 '06 #5
after i change to function...

still having same problem.... :(

May 7 '06 #6
You have to put all the code inside the onclick property.

<a href="#" onclick="Call
setTextBoxValue ('<%#Container. DataItem("Seria lNumber")%>')">

or if you use the syntax without paranteses:

<a href="#" onclick="setTex tBoxValue
'<%#Container.D ataItem("Serial Number")%>'">

Why are you using VBScript for the client code anyway? You are aware
that it only works in Internet Explorer and no other browsers?

zh*****@gmail.c om wrote:
if i put like this...
<a href="#" onclick=Call
"setTextBoxValu e('<%#Container .DataItem("Seri alNumber")%>')" >
<%#Container.Da taItem("SerialN umber")%> </a>

return error msg:syntax error

May 7 '06 #7
Rewrite your code and post it here so that it doesn't use any database
calls, so we can run and test it.

Jeff
<zh*****@gmail. com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
after i change to function...

still having same problem.... :(

May 17 '06 #8

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

Similar topics

5
21990
by: Geert-Pieter Hof | last post by:
Hello, I have written an application in Visual Basic 6.0 Professional SP5 that reads data from an Excel workbook by using ADO. When I close the application, I get the error: 'The instruction at "0x01b302bd" referenced memory at "0xb52ad202". The memory could not be "written"' - this only happens with the compiled exe (both P-code and native code), but
119
4640
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see, http://www.alistapart.com/articles/betterliving/ I read on http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/netfxcompat.asp It said they changed stuff like this
1
2647
by: fang | last post by:
Really confusing, I am using visual stdio C++ 6.0 I add a new project file into my current workspace. If I use the default output directory like default and release, everything works fine. But after I change my output directories to some other direcotries. The errors happened: build error, The output directory can not be created! But all of the old project files whose output directories are the same
2
5304
by: Steve Holden | last post by:
I'm trying to copy data from an Access database to PostgreSQL, as the latter now appears to work well in the Windows environment. However I'm having trouble with date columns. The PostgreSQL table receiving the data has the following definition: CREATE TABLE Lines ( LinID SERIAL PRIMARY KEY, LinDate TIMESTAMP(0), LinQty INTEGER,
3
11736
by: Reney | last post by:
I am using Access Database in my program. The column in the table that I am going to use has date/time value with Medium Time selected. (HH:mm). The program is recording a clock in time to this field, which is the time when the entry is made. If you check the database, it shows the correct time in the correct format. But when you are calling it with a dataset and showing with a datagrid, it doesn't show the time value but it always shows...
2
1396
by: loga123 | last post by:
Hi All, I am new to .net. I am creating a text box in a "button1" "click event" dynamically based on user input. Name of the text box and ID of the text box contro are set dynamically in the server side code. How can make this text box accessable in another "sub" or "button2" click event? Any help is greatly appreciated.' thanks
2
1615
by: GreggaR0und | last post by:
Hello; I am doing some data validation within InfoPath. One of my forms uses VBscript, not JScript, but I'm hoping this is still the best forum to post my issue. When I use the ReportError function to produce an error, I get a compile error that says: "Cannot have parentheses in a sub procedure". My code is as follows:
4
2034
by: =?Utf-8?B?Qm9iIEgu?= | last post by:
I'm trying to execute selectsinglenode(string_var) where where string_var contains the value ".//NetIncome(YTD)_Member/Series". The opening and closing parentheses are literals (not defining a function or serving a grouping purpose). I get an error: msxml3.dll: Unknown method. .//-->NetIncome(YTD<--)_Member/Series How do I get selectsinglenode to treat the parentheses as literals? I've tried a variety of escape sequences to no avail.
4
4255
by: jorgejch | last post by:
Hello, I've started with python (3) recently. Initialy only for scripting. Now I'm trying the object oriented bit. I'm getting the following error message <Atom.Atom object at 0x7f0b09597fd0> Traceback (most recent call last): File "./Main.py", line 7, in <module> print (t.getAtomName()) File "/home/jorge/Documentos/projetos/mestrado/códigos/cartesian_zmatrix/Atom.py", line 22, in getAtomName return atomName
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7565
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.