Print Page | Close Window

ASP LEN/IsNumeric Problems.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6385
Printed Date: 31 March 2026 at 3:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP LEN/IsNumeric Problems.
Posted By: davidshq
Subject: ASP LEN/IsNumeric Problems.
Date Posted: 13 October 2003 at 2:23pm

Hi Folks,
   I have a search directory located at http://www.civilwarsearch.com - www.civilwarsearch.com . However I am having some problems with some of the code. It is very strange as it did work in the past and then suddenly ceased working.
   What the code does is allow one to edit a link and part of the editing can include moving a link from one category to another. Now in order to do that what the script does is generates a list of categories, their category ids, and their parent category id. The individual updating the link selects from the drop down box which category they desire. This code is then passed to the next page which actually carries out the command. It fulfills the command by doing a LEN on the option selected for the category (b/c the value is not simply the parent category id it is moving to but as mentioned about its own id, name (text), and parent category id). Using this LEN it then moves from the right to the left finding the numeric expressions till it hits a non-numeric expression. This is the category number. It then is supposed to update the links parent category id in the database with the number found, however instead it seems to be generating non-random negative numbers. Here is the code that I believe is creating the problem:
Dim txtLinkCategoryIDvar
Dim CategoryNumber
Dim CategorySame
Dim i

CategoryNumber = txtLinkCategory
txtLinkCategoryIDvar=0
For i = LEN(CategoryNumber) To 1 Step - 1
 If IsNumeric(Left(CategoryNumber, i)) Then
 txtLinkCategoryIDvar = CLNG(Left(CategoryNumber, i))
 Exit For
End If
 Next

  I am afraid I can't really post more code than this b/c of licensing restrictions by FullRevolution...This code was actually developed as a modification to the script mainly with the help of some folks as aspmessageboard.com. Thanks for your help.

Respectfully,
David Mackey.

- www.civilwarsearch.com




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net