'============================================================================
'  SAMPLE2.BAS
'
'  This demonstrates a rudimentary template script.  A data file is
'  specified at the start of the script.  A contour map and surface
'  plot is then generated.  This can be applied to any data file by
'  changing the value of File$ appropriately.
'
'============================================================================

' Create the Surfer application object.
Set Surf = CreateObject("Surfer.App")

' Specify the input data file and the output grid file

Path$ = Surf.StartupPath()
InFile$  = Path$+"\DEMOGRID.DAT"
OutFile$ = Path$+"\SAMPLE"

' Create a new plot window
Surf.FileNew()

' Grid the data file
if Surf.GridData(InFile$, GridMethod=1, SearchRad1=4.53, SearchRad2=4.53, OutGrid=OutFile$) = 0 then end

' Create a filled contour map
if Surf.MapContour(OutFile$, Flags=1, ID="Contour #1") = 0 then end

' Select the contour map
Surf.Select("Contour #1")

' Move and size the current selection.
Surf.TransformSel(Left=1, Bottom=0, Width=7, Height=5)

' Create a surface plot.
if Surf.MapSurface(OutFile$, xLineColor="Blue", yLineColor="Blue", ID="Surface #1") = 0 then end

' Select the contour map
Surf.Deselect()
Surf.Select(ID="Surface #1")

' Move and size the current selection.
Surf.TransformSel(Left=1, Bottom=6, Width=7, Height=5)
