p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Re: Split Function


Message #1 by psinghp@e... on Fri, 07 Dec 2001 10:19:53 +0400
you said:

  This calculates Number of items in the array cScope.
  cScope is 0 based array so actual number on 1 based
  system will cNum=1


---what do you mean by this?


..on another note:


cNum=ubound(CScope,1)


the ,1 is not really needed.  Ubound defaults to the first dimension, and 
since split() on returns an array with a single dimension, then were fine 
without it.

you can also find the base of the array using lbound()...so counting the 
number of items could be done like:

count = ubound(CScope) - lbound(CScope)

/rob



At 10:19 AM 12/7/2001 +0400, you wrote:
>I use this in my program and it works.
>
>Splits the SScope into its elements and stores result
>in cScope
>
>            CScope=split(SScope,",")
>
>Determine the number of items in cScope
>
>            cNum=ubound(CScope,1)
>
>  This calculates Number of items in the array cScope.
>  cScope is 0 based array so actual number on 1 based
>  system will cNum=1
>
>HTH
>
>Pepe
>
>
>
>
>$subst('Email.Unsub').


Robert Chartier
Author and Developer
xxx-xxx-xxxx
rob@a...
http://www.aspfree.com/devlinks
http://www.aspfree.com/authors/robert
http://www.aspalliance.com/nothingmn
http://www.15seconds.com/issue/wa.htm#chartier


  Return to Index