I have a very odd bug going on here that I can't seem to work out.
function GetCommandLineParameter$(param$)
lena#=len(param$)+1
lenb#=len(CL$())
findparam# = find sub string$(CL$(), param$)
if findparam#>0
paramresult$ = right$(CL$(), lenb#-lena#)
findparam# = find sub string$(paramresult$, "-")
if findparam#>0
paramresult$ = left$(paramresult$, findparam#-2)
exitfunction paramresult$
else
exitfunction paramresult$
endif
endif
endfunction "!"
This function works pefectly when called.
mapovr$=GetCommandLineParameter$("-m")
This returns any string placed after -m in the command line. EG "-m C:/mapmath/map.dbo"
However, when I then come to closing the app (using any method) it simply crashes. If I don't call the function anywhere, it acts normally, but calling it simply once will then cause a crash when the app comes to close.
Any ideas?
Thanks
So there! D=<