1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-09 23:35:13 +00:00

Default_StartDir is now shared between SaveFile() & OpenFile()

This commit is contained in:
Samuel Gomes 2023-08-24 21:57:35 +05:30
parent 634bee63eb
commit 1fc5792d57

View file

@ -20292,8 +20292,9 @@ end sub
' Download = MKI$(0) 'still working
'END FUNCTION
FUNCTION SaveFile$ (IdeOpenFile AS STRING)
STATIC Default_StartDir$
SHARED Default_StartDir$
IF Default_StartDir$ = "" THEN
Default_StartDir$ = _STARTDIR$
@ -20327,22 +20328,21 @@ FUNCTION SaveFile$ (IdeOpenFile AS STRING)
END FUNCTION
Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the old IDE file load/save dialog routines
STATIC Default_StartDir$
FUNCTION OpenFile$ (IdeOpenFile AS STRING) 'load routine copied/pasted from the old IDE file load/save dialog routines
SHARED Default_StartDir$
IF Default_StartDir$ = "" THEN
Default_StartDir$ = _STARTDIR$
if Right$(Default_StartDir$, 1) <> idepathsep$ then Default_StartDir$ = Default_StartDir$ + idepathsep$
IF RIGHT$(Default_StartDir$, 1) <> idepathsep$ THEN Default_StartDir$ = Default_StartDir$ + idepathsep$
END IF
ideopenloop:
IF IdeOpenFile = "" THEN f$ = _OpenFileDialog$("Open Source File", Default_StartDir$, "*.bas|*.BAS|*.Bas|*.bi|*.BI|*.Bi|*.bm|*.BM|*.Bm", "QB64-PE Source Files", 0) ELSE f$ = IdeOpenFile
IF IdeOpenFile = "" THEN f$ = _OPENFILEDIALOG$("Open Source File", Default_StartDir$, "*.bas|*.BAS|*.Bas|*.bi|*.BI|*.Bi|*.bm|*.BM|*.Bm", "QB64-PE Source Files", 0) ELSE f$ = IdeOpenFile
IF f$ = "" THEN OpenFile$ = "C": EXIT FUNCTION
path$ = ideztakepath$(f$)
Default_StartDir$ = path$
if Right$(Default_StartDir$, 1) <> idepathsep$ then Default_StartDir$ = Default_StartDir$ + idepathsep$
IF RIGHT$(Default_StartDir$, 1) <> idepathsep$ THEN Default_StartDir$ = Default_StartDir$ + idepathsep$
IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN 'see if the user forgot the .bas extension and check for the file
@ -20415,7 +20415,8 @@ Function OpenFile$ (IdeOpenFile as string)'load routine copied/pasted from the o
idepath$ = path$
IdeAddRecent idepath$ + idepathsep$ + ideprogname$
IdeImportBookmarks idepath$ + idepathsep$ + ideprogname$
end sub
END FUNCTION
SUB ExportCodeAs (docFormat$)
' Get the current source code, convert it to the desired document format and