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 (Adding new author and category links.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{PageAuthor|Afrow UK}}
== Description ==
== Description ==
This function will slice up a URL for use with Lobo Lunar's Internet.dll plugin.
This function will slice up a URL for use with Joel's Internet.dll plugin.


== Usage ==
== Usage ==
Line 57: Line 59:
-Stu
-Stu


Page author: [[User:Afrow UK|Afrow UK]]
[[Category:Internet Functions]]

Latest revision as of 12:20, 24 June 2005

Author: Afrow UK (talk, contrib)


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