Home
Username:
Password:
Macromedia ColdFusion Tutorials

The Films Page / LEFT; Finish cleaning up results; and suggestions




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

So what we want to do now is get rid of this stuff down here, and if we look at the source, we can find a point that we can grab. Here is the beginning of the results string, and it ends down here. If we do another find, it looks like the first non-valid piece of content as far as we are concerned, what we are trying to do is show this, and this, and this. Each one of these is a line in our results here, it's each one of these lines - 'east wind, west wind: Pearl S Duck' - you know that's in here. That's this one here, where is it? East wind, west wind. So the first thing that's not a movie is an HR. Hey, we have done that before, we can do that again. Let's search for HR. We'll go back a letter because we now know that if we do a finds on HR, it actually leaves the point to right here. We'll get that number, we'll subtract one, and then we will just lop it off all the way to the very end of the string. So how do we represent that? Well, what we could do is we could say cfset end = find in the string HR looking for that end results. And then what we want to do is we want to do another cfset results, but instead we are going to do left. Because, we want to take the left side of the string now, not the right side. We want to take the left side, which actually is this up to here, that's the left side of the string, this is the right side. So we want to take the left side of it from results, we want to do end minus 1. So take the left side of the results end-1. Let's see what end looks like as well. Let's put it inside. Alright save it, copy it, paste it, update it, it's a mantra, it's a way of life, refresh it, and look at that. So that was start, that was end and this all the way up to here is our string. Right, we will take the extra stuff out now so that all we just have is a beautiful clean results. Save it, copy it, paste it, update it, refresh it, and isn't that pretty? So this is where we were at the very beginning. If you want to get fancy now, we could go and pull the results of each one of these URLs, do the same thing on this content, find that HR, replace out from that. Find the word subjects, replace out from that, or you know take the left side from here and the right side from here so we have just this or maybe even there's got to be something in here. Let's see what can we find in here. Where is that number? Right here, we could probably say from the second closed B, now we don't know how long this is, we can probably say first P after here, or we can go up to the HR, remove that and then look for the first p and then remove that or actually no, the H4 right there. This is unique, so search up to the H4, and remove all that by saying you want from the string starting at this point all the stuff on the right. Do a search and replace on the H4 and the close H4 to get rid of that, and then you will have all this, and then do a search on subjects and there you've got it. You've got all this content from the P out here, and you could pull those in one at a time and make an array. So that's your homework. See if you could do that, we'll have that hidden somewhere at the end of this CD in tidbits. ee if you could do that, we'll have that hidden somewhere at the end of this CD in tidbits.

Tutorial Information

Course: Macromedia ColdFusion
Author: Mike Muller
SKU: 33287
ISBN: 1930519656
Release Date: 2001-12-19
Duration: 8 hrs / 86 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available