$ if (P1 .eqs. "")
$ then
$ write sys$output "Extraction Fields Not Entered
$ write sys$output "Usage: @fstring 1:10 20:3 30:5 10:7 etc..
$ write sys$output "    Maximum is 8 parameters on the command line
$ goto endit
$ else
$    fstring = P1
$ endif

$ if (P2 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2
$ endif

$ if (P3 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3
$ endif

$ if (P4 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4
$ endif

$ if (P5 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5
$ endif

$ if (P6 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6 
$ endif

$ if (P7 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6+" "+P7
$ endif

$ if (P8 .eqs. "")
$ then
$ else
$ fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6+" "+P7+" "+P8 
$ endif

$ start:

$ !fstring = P1+" "+P2+" "+P3+" "+P4+" "+P5+" "+P6+" "+P7+" "+P8

$ show symbol fstring
$ SP1 = ""
$ SP1 = F$locate(" ",fstring)
$ !SHOW SYMBOL SP1

$ i = 0
$ Start1:
$ length = F$LENGTH(fstring)
$ !show symbol length

$ fnew = fstring

$ if i .GT. length then goto endit

$ SP2 = F$Extract(i,SP1,fnew)
$ show symbol SP2

$ i = i + SP1 + 1
$ !show symbol SP1
$ fnew = f$Extract(SP1,length,fnew)
$ goto Start1
$ endit:
$ exit
