Error handling in ASP (VbScript 5) classes

Results 1 to 2 of 2

Thread: Error handling in ASP (VbScript 5) classes

  1. #1
    Join Date
    Dec 1969

    Default Error handling in ASP (VbScript 5) classes

    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.<BR><BR>I would be really thankfull if anybody could help me.<BR>Best Regards<BR>Bergur

  2. #2
    Join Date
    Dec 1969

    Default Crosspost <eop>


Posting Permissions

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