Forum Moderators: phranque

Message Too Old, No Replies

Need help with parsing

         

oogachaka

6:58 am on Jul 22, 2001 (gmt 0)



hey everyone

Could someone please help me with parsing a string? Here is an example of what I have now:

Dim Selection
if instr(strOrigURL,"/applications/") >0 then
Selection = "applications"
intStart = instr(strOrigURL,"/applications/") + 14
intApplications = replace(mid(strOrigURL,intStart),"/","")

What I want to be able to do is pass in a link value of something like /applications/10.html, and then parse out the 10. The current code above would return 10.html

Any help would be greatly appreciated.

Thanks
Bob

MikeFoster

7:57 pm on Jul 23, 2001 (gmt 0)

10+ Year Member



Something like this?

<script type='text/vbscript'>

folderName = "/applications/"
folderLength = len(folderName)
offset = instr(location.search, folderName)
if offset > 0 then
  fileName = mid(location.search, offset + folderLength)
  alert(fileName)
else
  alert("invalid file name")
end if

</script>

Bob1986

3:35 pm on Jul 30, 2001 (gmt 0)



da h*ll is parsing?

NFFC

3:43 pm on Jul 30, 2001 (gmt 0)

oogachaka

4:02 pm on Jul 30, 2001 (gmt 0)



I solved the problem. Sorry if you do not feel that I used the correct syntax. The term means to break into smaller pieces. i.e. I could parse /applications/10.html into

/applications/
10
.html