logo       

Re: adding to the middle of a string better organized: msg#00307

windows.autoit.user

Subject: Re: adding to the middle of a string better organized

SetBatchLines,150
;next line wrapped
SetEnv,line,Please visit http://KirkhamsEbooks.8m.com for ebooks
videos and software

;after a filereadline add this check
IfInString,line,http://,Gosub,reformatLink
MsgBox,4096,debug,%line%
Exit

reformatLink:
StringLen,var1,line
StringGetPos,var2,line,http://
StringLeft,piece1,line,%var2%
EnvAdd,var2,8
SetEnv,piece2,

reformatLink_getLink:
IfGreater,var2,%var1%,Goto,reformatLink_construct
StringMid,char,line,%var2%,1
SetEnv,charCheck,*%char%*
IfEqual,charCheck,* *,Goto,reformatLink_construct
SetEnv,piece2,%piece2%%char%
EnvAdd,var2,1
Goto,reformatLink_getLink

reformatLink_construct:
EnvSub,var2,1
StringTrimLeft,piece3,line,%var2%
;next line word-wrapped
SetEnv,line,%piece1%<A HREF="http://%piece2%%piece3%";>http://%piece2%
</A>

Return

this should work for ANY line with 1 link in it. Several links breaks
the deal... :)

> > Please visit <A HREF="http://KirkhamsEbooks.8m.com for
> > ebooks videos and
> > software">http://KirkhamsEbooks.8m.com</A>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchNetworking.com to access over 500 white papers.
Get instant access at SearchNetworking.com Today
http://us.click.yahoo.com/YyjvfD/OLNGAA/uitMAA/EGnolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
AutoItList-unsubscribe@xxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise