Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2003, 07:51 AM
Registered User
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default extracting substrings

Hello there!
I've looked this over a hundred times and can't seem to figure out WHY I keep getting this error message....

Microsoft VBScript runtime error '800a01a8'
Object required: 'F:/data/raster/1000k'
/IS5i/i_test.asp, line 148


Here is the code:
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/if mRasters.EOF then
        response.write("pas de rasters selectionné")
    else
        ReDim arrRasters(0)
        i=0
        do while not mRasters.EOF
            arrRasters(i)=mRasters("IMAGE")
            mRasters.MoveNext
            i=i+1
        loop
        for i=0 to Ubound(arrRasters)
            response.write(arrRasters(i)&" <br>")
        next
    end if
    mRasters.close
    for i=0 to Ubound(arrRasters)
                lImage = CStr(arrRasters(i))
************************************************** *
HERE------> laLimite = lImage.lastindexof("/")
************************************************** ****
        nomImage = CStr(lImage.substring(laLimite,lImage.length))
        repertoire = CStr(lImage.substring(0,laLimite))
        response.write("le nom du raster est: "&nomImage&" et son chemin est: "&repertoire)
    next

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
I've checked to see what the actual string looks like and it's something like this F:/data/raster/1000k/mic98/6_4.tif


I really don't get what could be wrong :o( so any clue would be greatly appreciated!

Thanks all!

"Don't you ever feel as though your computer is possessed?"
 
Old November 13th, 2003, 08:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Look up the instrrev-function...
I think what you need is something like this:

laLimite = instrrev(lImage, "/")


 
Old November 13th, 2003, 08:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

I think you are mixing JavaScript in your VBScript...
The lines following will also give you errors...

Rewrite along these lines:

nomImage = CStr(right(lImage,len(lImage)-laLimite))
repertoire = CStr(left(lImage,laLimite))

 
Old November 13th, 2003, 09:06 AM
Registered User
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yep it all works just fine!!! :o)

Thanks to both of you!! :o*

"Don't you ever feel as though your computer were possessed?"
 
Old November 13th, 2003, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Both of me ;) are happy to help...

 
Old November 13th, 2003, 11:56 AM
Registered User
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

LOL :D
look at that! I'm so caught up in what I'm doing that I'm mixing everything up! Let me explain: I had two answers on different forums so I went ahead and thanked both of you!!
which reminds me : I didn't go back to thank the other guy! (ain't that pathetic!)

"Don't you ever feel as though your computer were possessed?"





Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting attribute value hag XSLT 1 March 3rd, 2008 03:16 AM
XSLT substrings chroniclemaster1 XSLT 1 October 4th, 2007 05:29 PM
string extracting fraijo SQL Server 2000 4 October 25th, 2006 09:53 PM
Extracting Text Jeff Mason BOOK: Beginning Regular Expressions 1 October 24th, 2006 06:38 AM
extracting atributes - how to do this? zoreli XML 6 August 12th, 2006 03:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.