Find all links in fld

John Dixon dixonja at hotmail.co.uk
Fri Jan 16 15:27:16 EST 2015


Very simple solution

on mouseUp
   repeat for each word thisWord in fld 1
      if char 1 to 4 of thisWord = "http" then
         put thisWord & cr after tempList
      end if
   end repeat
   put tempList
end mouseUp

> Date: Fri, 16 Jan 2015 14:19:38 -0600
> Subject: Find all links in fld
> From: shawnlivecode at gmail.com
> To: use-livecode at lists.runrev.com
> 
> I'm still struggling with this, so I'm asking for a little help.
> 
> I'm trying to extract the links from the field.  All the links will start
> the same, but the last 5 digits will be different.
> 
> *on* mouseUp
> 
>    *put* URL "http://mydomainA.com/rss.php" into tURL
> 
>    *put* tURL into fld "fld1"
> 
>    *find* string "https://www.domainB.com/show.php?l=0&u=156&id=" in fld
> "fld1"
> 
> --- I'll need the whole URL
> https://www.domainB.com/show.php?l=0&u=156&id=xxxx
> 
> -- notice the xxxx -- that changes from link to link
> 
>    *put* the foundText into tFound
> 
>    *put* tFound into fld "fld2"
> 
> *end* mouseUp
> 
> 
> When I add a repeat it never stops and locks up LC. but I'm still missing
> the xxxx.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
 		 	   		  


More information about the use-livecode mailing list