close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Syntax error with Sub procedure

Thread began 2/03/2011 5:24 am by Fritz Stickers | Last modified 2/24/2011 3:14 pm by Jason Byrnes | 1976 views | 13 replies |

Fritz Stickers

Syntax error with Sub procedure

What's wrong with this syntax on line 156 ?
This script works on another page where I don't use WA_UEmail.


Geert.

Attached Files
Confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you have the sub defined inside of the function WA_Universal_Email_1_SendMail(RecipientEmail) code.

a sub cannot be defined inside of a function, you will need to move the sub routine code outside of the function code.

Sign in to reply to this post

Fritz Stickers

And how can I get/use then the value (from that script) that I need in the WA_UEmail ?

Sign in to reply to this post

Jason ByrnesWebAssist

You have to add the values to the MailBody string:

Public MailBody
Sub OddEvenNumber(iNumber)
If iNumber MOD 2 = 0 Or varBTWnr > "0" Then
MailBody = MailBody & IBAN : BE02 9793 3516 7640
Else
MailBody = MailBody & IBAN : BE11 9730 2045 8748
End If
End Sub

Sign in to reply to this post

Fritz Stickers

Sorry, but I don't understand how to do this.
I tried a few things in vain.

Sign in to reply to this post

Jason ByrnesWebAssist

what your trying to do really doesn't need a sub routine.


from your original page, change this code:
varPostcode=Left((rsUsers.Fields.Item("Postcode").Value),2) 'geeft linkse 2 getallen
varBTWnr=(rsUsers.Fields.Item("BTWnummer").Value)
Call OddEvenNumber(varPostcode)
Sub OddEvenNumber(iNumber)
If iNumber MOD 2 = 0 Or varBTWnr > "0" Then
Response.write ("IBAN : BE02 9793 3516 7640")
Else
Response.write ("IBAN : BE11 9730 2045 8748")
End If
End Sub

to:
varPostcode=Left((rsUsers.Fields.Item("Postcode").Value),2) 'geeft linkse 2 getallen
varBTWnr=(rsUsers.Fields.Item("BTWnummer").Value)
If varPostcode MOD 2 = 0 Or varBTWnr > "0" Then
MailBody = MailBody & "IBAN : BE02 9793 3516 7640"
Else
MailBody = MailBody & "IBAN : BE11 9730 2045 8748"
End If



you're over complicating it by using the sub routine.

Sign in to reply to this post

Fritz Stickers

thanks ... works nice now ! :)

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear it is working.

Sign in to reply to this post

Fritz Stickers

After a while, it seems that there is something wrong. A lot of mails only give the first option (IBAN : BE02 9793 3516 7640). I get the right copy (BCC), but the customer receives the wrong one.
Can't I solve this in another way ?
E.g. : two different Universal Email, one for each option.

Geert.

Sign in to reply to this post

Jason ByrnesWebAssist

loooking closely at your page, you already have wo instances of universal email applied to the page.

The first instance is sending the message to the customer, the second instance is sending the message to you, but the mail body's of the two instances are not the same, this is why you are receiving a different email than the customer.


either set both email bodys to be the same, or set one of the emails to bcc the other recipient.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...