Hello,
I have a basic code to take user input of variables that are passed to a batch script for running like the following:
Sub gmtRun
'define the region of interest -Rwest/east/south/north
west = inputbox("West: ","Western limit")
east = inputbox ("East: ","Eastern limit")
south = inputbox ("South: ","Southern limit")
north = inputbox ("North: ","Northern limit")
'Define the SI values for land and seafloor density for Bouguer correction
land_density = inputbox ("Land density: ","Crustal density (Land) kg m-3")
seafloor_density = inputbox ("Seafloor density: ","Seafloor density kg m-3")
'Specify the Long wavelength filter (km) for Bouguer residual and short wavelength filter (to clean noise)
LW_filter = inputbox ("Long wavelength filter (km): ","Long wavelength filter (e.g. 250 km)")
SW_filter = inputbox ("Short wavelength filter (km): ","Short wavelength filter (e.g. 25 km)")
'Create a default prefix to all generated files
prefix = inputbox ("Filename prefix (e.g. NATL etc.): ","Filename prefix (area or project code)")
'Run the primary GMT processing script (batch file) passing the variables input via VBS
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "GMTprocess.bat " & west & " " & east & " " & south & " " & north & " " _
& land_density & " " & seafloor_density & " " _
& LW_filter & " " & SW_filter & " " _
& prefix, 0, True
' ...prefix, 1, True (cmd window opens and runs until finish), ...prefix, 0, True (cmd window run hidden)
set WshShell = nothing
self.close
End Sub
This all works fine and does the job needed. However, if the user types a wrong value or wants to go back and change something, there is no easy way to get out apart from clicking through all the entries to exit. So for example, is there a simple way to add a check option or go back to the start to correct things?
Thanks for any pointers
Lester