Error handling in ASP (VbScript 5) classess

Results 1 to 2 of 2

Thread: Error handling in ASP (VbScript 5) classess

  1. #1
    Join Date
    Dec 1969

    Default Error handling in ASP (VbScript 5) classess

    Hi there.<BR><BR>I&#039;m making a class, in which I use getRows to convert my recordset to an array, then I have a property with an index so that the class-user can retrieve a value from a certain column (I have one property for each column).<BR><BR>public property get Column1(nRecord)<BR> Column1 = aNews(0,nRecord)<BR>end property<BR><BR>Where Column1 is some sort of a ID in my database.<BR><BR>This works fine BUT lets say that in this two dimensional array, there are 2 records. So the class-uer can enter the values 0 or 1 for nRecord.<BR><BR>Now lets assume the class-user enters the value 2 (meaning record 3, because it starts at 0) because of this an error message will pop up and say something like "Subscript out of range"<BR><BR>What I want to do (so I finally get to the point) is to raise a readable errormessage if the class-user enters að value higher than the number or records in the array.

  2. #2
    Join Date
    Dec 1969

    Default Nothing to do with classes...

    ...or with version 5.5.<BR><BR>Same as it&#039;s always been in VBS:<BR><BR>Click on "VBScript Reference" in the left panel of this page.<BR><BR>Click on "Objects and Collections" in the list that appears.<BR><BR>Click on "Err Object" in the list that then appears.<BR><BR>[ Look at the example on that page. ]<BR><BR>Click on "Err Object Properties and Methods" near the bottom of that page.<BR><BR>Click on "Raise Method" in the list that appears.<BR><BR>Read.<BR><BR>Just incidentally, note the version number where this is implemented in the "Requirements" paragraph.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts