Get URL segments for Joel's Internet plugin: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.) |
m (SF: Lobo Lunar -> Joel.) |
||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
This function will slice up a URL for use with | This function will slice up a URL for use with Joel's Internet.dll plugin. | ||
== Usage == | == Usage == |
Revision as of 15:45, 27 April 2005
Description
This function will slice up a URL for use with Joel's Internet.dll plugin.
Usage
Push "http://hmd.hostileintent.org/database/mapupdater.txt" Call ParseURL Pop $R1 Pop $R0 # $R1 = database/mapupdater.txt # $R0 = hmd.hostileintent.org Internet::GetUrlCode $R0 $R1 $0 DetailPrint $0 # print URL code
The Function
Function ParseURL Exch $R0 ; url Push $R1 Push $R2 Push $R3 StrCpy $R2 0 Loop1: IntOp $R2 $R2 + 1 StrCpy $R1 $R0 1 $R2 StrCmp $R1 "" Done StrCmp $R1 "/" 0 Loop1 IntOp $R2 $R2 + 2 StrLen $R1 $R0 IntOp $R2 $R1 - $R2 StrCpy $R0 $R0 "" -$R2 StrCpy $R2 0 Loop2: IntOp $R2 $R2 + 1 StrCpy $R1 $R0 1 $R2 StrCmp $R1 "" Done StrCmp $R1 "/" 0 Loop2 StrCpy $R1 $R0 $R2 IntOp $R2 $R2 + 1 StrLen $R3 $R0 IntOp $R2 $R3 - $R2 StrCpy $R0 $R0 "" -$R2 Done: Pop $R3 Pop $R2 Exch $R1 ; address Exch Exch $R0 ; rest FunctionEnd
-Stu
Page author: Afrow UK