Is it possible to get mapbasic to use the current directory for processes?
So rather than the following where WFolder is manually set as the working folder can I get it to just work in the folder where the mbx is?
Include "MapBasic.def"
Include "Menu.def"
Declare Sub Main()
Dim filename, printtext,WFolder as string
Dim rcount,i as Integer
Sub Main()
Close All
'OnError GoTo CaughtEx '// Turn Error handling on
WFolder="D:\Projects\AsCon_data\Output\OceanBreeze_4B_4C\"
Register Table "D:\Projects\AsCon_data\Output\OceanBreeze_4B_4C\List.txt" TYPE ASCII Delimiter 9 Titles Charset "WindowsLatin1" Into WFolder+"~MAP0001.TAB"
Open Table WFolder+"~MAP0001.TAB" Hide
Commit Table ~MAP0001 As WFolder+"List.TAB"
Close Table ~MAP0001
Open Table WFolder+"List.TAB" as List Interactive
Browse * From List
rcount=TableInfo(List,TAB_INFO_NROWS)
i=1
While i<=rcount
Select * from List where List.RowID=i into RSelection
Browse * from RSelection
print RSelection.col1
Open Table RSelection.col1 as temptable
' Do some action(s)
commit table temptable
i=i+1
close table temptable
Wend
CaughtEx: '// error handling routine
'// Log error here...
print Chr$(13)+Chr$(13)+"///////MAIN///////"+Chr$(13)+"FAILED due to:"+Chr$(13)+Error$()+Chr$(13)+"\\\\\\\\\\\\\\\"+Chr$(13)
Resume Next '// resume code at line after the one which threw the error
End Sub