473,394 Members | 1,785 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,394 software developers and data experts.

Syntax for function call to eventobj.ReportError causes "Cannot have parentheses..."

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:

Expand|Select|Wrap|Line Numbers
  1. sub msoxd__tblTestCase_TestCaseID_attr_OnValidate(eventObj)
  2. dim objError
  3. dim objStr
  4.  
  5. if IsNumeric(eventObj.Site.nodeTypedValue) then
  6.    if LEN(eventObj.Site.nodeTypedValue) < 3 OR LEN(eventObj.Site.nodeTypedValue) > 4 then
  7.       eventobj.reporterror (eventobj.site, "must be 3 chars in len", false)
  8.       msgbox("Must be 3 CHARS IN LENGTH.  ")
  9.    END IF
  10. else
  11.    eventobj.reporterror (eventobj.site, "must be numeric", false)
  12.    msgbox("Must be 3 CHARS IN LENGTH.  ")
  13. end if
  14. XDocument.UI.Alert("Error message: ")
  15. End sub
  16.  
Now, obviously, there are other function calls within the sub which work properly, so I think the error message is the compiler balking at something else. Also, when I put the ReportError expression in the Watch window, it displays the proper results.

What am I doing wrong?

Thanks!
May 21 '07 #1
2 1596
iam_clint
1,208 Expert 1GB
what language is this? looks like vbscript
May 21 '07 #2
Yes, it is VBscript. I changed the InfoPath programming language to VB instead of Jscript because I thought it would be easier to work with. I didn't see a VBscript forum, though, so I posted it, here. Is there a more appropriate forum to post in?

Thanks
May 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Michael Stevens | last post by:
Probably the wrong wording but since I'm not a scripter I won't claim to know what I'm talking about. I got this script from www.htmlgoodies.com <script language="JavaScript"> <!--...
7
by: Vaca Louca | last post by:
Hello, My setup: Debian sarge on dual Pentium 4. g++ 3.3.5-3. (the other system is Windows XP with MS Visual Studio .NET 2003) I have an auto_array<T> template (based on a template taken from...
0
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add...
4
by: RedJoy | last post by:
I am switching from VS2003 .NET to VS2005 and I receive the following errorwhen compiling my project: error C3821: 'File': managed type or function cannot be used in an unmanaged function...
15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
2
by: Aarti | last post by:
Say I have a class template as follows template<typename T> class foo { public: void test(); }; template<typename T>
10
by: jonathanemil | last post by:
Hello, I am a 1st semester Computer Science student in a Python class. Our current assignment calls for us to read a list from a file, create a 2-dimensional list from the file, and check to see...
6
by: hadad.yaniv | last post by:
Hello, i am new to c++, i hav a vector of typed object: vector<Man*People; When i do a second pushback, even for the same object the program crash say: "An Access Violation (Segmentation...
3
by: pinko1204 | last post by:
My Update function cannot successful update to sql table even don't have any error. Please help to check .....thx PHP1 <?php require_once 'header.php'; ?> <style type="text/css"> <!--
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...

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.