Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

code error

Posted 15 Apr 2004 16:02:46
1
has voted
15 Apr 2004 16:02:46 Dave Thomas posted:
right, im trying to add a preview function to a form ive made.

i get the window to open , but im having a problem carrying my data over to the preview window.

i get an error when im trying to show a memo field using Replace to format the line breaks.

Error message i get is ::
Cannot use parentheses when calling a sub

Ive looked it up in the MSDN scripting section and it tells me that im calling the sub without using the Call function, or to remove the parentheses from the statement.

anyone done this successfully?

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com

Replies

Replied 15 Apr 2004 16:36:41
15 Apr 2004 16:36:41 Vince Baker replied:
Are you using the followoing:

<% = Replace(rsName("FieldName", VbCrLF, "<br>" %>

If so, there could be a ' character that is screwing your code up in the memo field... If so, you will have to reaplce that character as well.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 15 Apr 2004 16:43:13
15 Apr 2004 16:43:13 Dave Thomas replied:
yes vince im using that syntax

there is no ' in the memo, it was tested with a simple message field of

testing line 1
testing line 2
testing line 3
end test line 4

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 16 Apr 2004 02:36:18
16 Apr 2004 02:36:18 Vince Baker replied:
i will have a look back at some old code i wrote as i had this error a while back, i will try to look where and why it happened

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 17 Apr 2004 01:28:42
17 Apr 2004 01:28:42 Phil Shevlin replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Error message i get is ::
Cannot use parentheses when calling a sub
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>Try putting the word "call" before the function that is throwing this error. It will solve the problem. I run acrosss it often.
Replied 17 Apr 2004 15:43:52
17 Apr 2004 15:43:52 Dave Thomas replied:
sorry, i can be an idiot at times.

i am using this code
<pre id=code><font face=courier size=2 id=code>&lt;% = Replace(Request.Form("txtComments", VbCrLF, "&lt;br&gt;" %&gt; </font id=code></pre id=code>

not the replace.rs.fields code as the record doesnt even exist yet .DOH!

Put Call before what?

<pre id=code><font face=courier size=2 id=code>&lt;% = Call Replace(Request......) </font id=code></pre id=code>

like so ??



Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 17 Apr 2004 16:34:49
17 Apr 2004 16:34:49 Phil Shevlin replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote><pre id=code><font face=courier size=2 id=code>&lt;% = Replace(Request.Form("txtComments", VbCrLF, "&lt;br&gt;" %&gt; </font id=code></pre id=code><hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Hmmm. I use that all the time. Are you sure thats the line of code causing the error? Have you commented out this line?

My only other suggestion would be to substitute response.write for the "=".
Replied 18 Apr 2004 13:02:27
18 Apr 2004 13:02:27 Dave Thomas replied:
well the reason the data isnt being passed is because the form isnt getting posted properly.

it will post ok if i hit the submit button, but the preview button has no value other than to pop open a page.

can i have 2 submit actions doing 2 different things?

only ever used forms for basic purposes before.

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com
Replied 18 Apr 2004 16:29:47
18 Apr 2004 16:29:47 Dave Thomas replied:
answered my own question.

sorted it now guys, thx for your input.

had to use the onClick function on my 2 submit buttons, left the form action blank, and assigned each button a form action .

all works, so happy days <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com

Reply to this topic