String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands >

String Operations

URL. - Split URL

Previous Top Next


MiniRobotLanguage (MRL)

 

URL. Command

split URL

 

 

Intention

 

Splits an internet URL into its different parts.

 

Example:

 

: $$NUM=1

: $$MAN=http://www.fa2.de/asc-ansi-tabelle.htm

' Output is placed inside these variables in order

URL.$$MAN|$$V00|$$V01|$$V02|$$V03|$$V04|$$V05|$$V06|$$V07

PRT.Protokoll: $$V00

PRT. www?: $$V01

PRT.Subdomain: $$V02

PRT. Domain-Name: $$V03

PRT. Top-level-Domain: $$V04

PRT. Filepath: $$V05

PRT. Filename: $$V06

PRT. File-Ext.: $$V07

MBX.!

END.

 

And here is the result:

 

graphic

 

 

 

Syntax

 

URL.P1[|P2 ... P9]

 

 

Parameter Explanation

 

P1 - (in) - URL to split into parts

 

P2 - (out) - protocol (http://, ftp:// etc.)

 

P3 - (out) - www. if there or empty

 

P4 - (out) - Sub-Domains if any

 

P5 - (out) - Domain-Name

 

P6 - (out) - Top-Level-Domain

 

P7 - (out) - Path

 

P8 - (out) - Filename

 

P9 - (out) - File-Extension

 

The Stack being used is the actual User-Stack.

It can be the Local User Stack or the Global User-Stack, which depends on Settings done with STS.-Command.

 

If the Popp'ed items are deleted from stack or not also depends on the Settings done with STS.

 

 

 

Example

 

'*********************************

' URL. Sample 1

'*********************************

: $$NUM=1

: $$MAN=http://www.it-berater.org

' All output is placed on Stack in reverse order

URL.$$MAN

DMP.4

MBX.!

END.

 

'*********************************

' URL. Sample 2

'*********************************

: $$NUM=1

: $$MAN=http://www.it-berater.org

' Output is placed inside these variables in order

URL.$$MAN|$$V00|$$V01|$$V02|$$V03|$$V04|$$V05|$$V06|$$V07

PRT.Protokoll: $$V00

PRT. www?: $$V01

PRT.Subdomain: $$V02

PRT. Domain-Name: $$V03

PRT. Top-level-Domain: $$V04

PRT. Filepath: $$V05

PRT. Filename: $$V06

PRT. File-Ext.: $$V07

MBX.!

END.

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.5.2 Working with Text-Strings

    GFT. - Get-File-Token

    GSS. - GetSplitString

    ! STR. - String Command