From 8d51ab873e20fc48c27ad67f29c3b8b316e38224 Mon Sep 17 00:00:00 2001 From: Armando Rivera Date: Fri, 13 Jan 2023 21:19:03 -0500 Subject: [PATCH] Added initial save file funtionality --- Aide.bas | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Aide.bas b/Aide.bas index 21a1507..3870ae2 100644 --- a/Aide.bas +++ b/Aide.bas @@ -134,6 +134,26 @@ SUB SetTabLabelText(fname$, index AS INTEGER) tabItem.cchTextMax = BCXSTRSIZE TabCtrl_SetItem(ghMainTab, index, &tabItem) +END SUB + +SUB RaSaveFile(hEDT as HWND) + DIM eSIZE, fNAME$, tabName$ + + eSIZE = GetWindowTextLength(hEDT) + DIM eTEXT$*eSIZE+1 + + tabName$ = GetTabLabelText(TabCtrl_GetCurSel(ghMainTab)) + ' msgbox(tabName) + + fNAME$ = GETFILENAME$("Save","BCX Files|*.BAS;*.INC;*.bi;*.bci",1,ghMainFrm,0,0,tabName$,0) + IF *fNAME$ THEN + eTEXT$ = BCX_GET_TEXT$(hEDT) + OPEN fNAME$ FOR OUTPUT AS FP1 + PUT$ FP1, eTEXT$, LEN(eTEXT$) + CLOSE FP1 + END IF + + END SUB '================================================================ @@ -157,7 +177,10 @@ BEGIN EVENTS IF *fname$ THEN SetTabLabelText(fname$, TabCtrl_GetCurSel(ghMainTab)) END IF - + + CASE mnuSave + RaSaveFile(ghEdit[TabCtrl_GetCurSel(ghMainTab)]) + CASE mnuNew RaNewEdit()