Post by mueh on May 31, 2019 12:20:58 GMT -5
Hi George !
Use now Macro Command in File Manager Tab (since 10.1 working) to set Commands to command line
with my own Command RETRIEVE Macro depending on Session Type File Path Name or Ext .
Would need following update to Get_Session_Type$ Function to know if i'm in FM Tab and
with new Get_Session_Title$ i can get type of FM display active .
Another usefull function i wish to have is to set CSR in Line 0 . Set_Csr(0,col) should set Csr in Command Line .
FUNCTION SET_CSR() AS EXT
'IF ilno > 0 AND ilno < TP.LastLine THEN ' Within range?
IF ilno >= 0 AND ilno < TP.LastLine THEN ' Within range?
I'm not shure if above Change is enough to work both in FM and Edit .
It also would be nice to have a Get_INI_FileName$ Function .
Would you be so kind to add this untested functions into next relase .
Use now Macro Command in File Manager Tab (since 10.1 working) to set Commands to command line
with my own Command RETRIEVE Macro depending on Session Type File Path Name or Ext .
Would need following update to Get_Session_Type$ Function to know if i'm in FM Tab and
with new Get_Session_Title$ i can get type of FM display active .
Another usefull function i wish to have is to set CSR in Line 0 . Set_Csr(0,col) should set Csr in Command Line .
FUNCTION SET_CSR() AS EXT
'IF ilno > 0 AND ilno < TP.LastLine THEN ' Within range?
IF ilno >= 0 AND ilno < TP.LastLine THEN ' Within range?
I'm not shure if above Change is enough to work both in FM and Edit .
It also would be nice to have a Get_INI_FileName$ Function .
Would you be so kind to add this untested functions into next relase .
_BMacro.inc
CALL DWORD hProc_thinBasic_LoadSymbol USING thinBasic_LoadSymbol("GET_SESSION_TITLE$", %thinBasic_ReturnString, CODEPTR(Get_SESSIONTITLE))
CALL DWORD hProc_thinBasic_LoadSymbol USING thinBasic_LoadSymbol("GET_INI_FILENAME$", %thinBasic_ReturnString, CODEPTR(Get_INIFILENAME))
FUNCTION GET_INIFILENAME() AS STRING
'---------- Get the current INI FileName
gMacroTHeader = "Get_INI_FileName$() "
FUNCTION = ENV.INIFileName: QErrorNull ' Pass back full INI FN
DoTrace ' Do trace if needed
END FUNCTION
FUNCTION Get_SESSIONTYPE() AS STRING
'---------- Get Tab type
LOCAL lText AS STRING
gMacroTHeader = "Get_Session_Type$() "
' lText = SWITCH$(IsBrowse, "BROWSE", IsView, "VIEW", IsClip, "CLIP-EDIT", IsSetEdit, "SET-EDIT", %True, "EDIT")
lText = SWITCH$(IsBrowse, "BROWSE", IsView, "VIEW", IsClip, "CLIP-EDIT", IsSetEdit, "SET-EDIT", IsFMTab, "FM", %True, "EDIT")
IF lText = "VIEW" AND TP.TIPROStat THEN lText = "RDONLY"
IF IsMedit THEN lText = "MEDIT" ' If MEdit, re-do it all
FUNCTION = lText
QErrorNull ' ZRC = OK
DoTrace ' Do trace if needed
END FUNCTION
FUNCTION Get_SESSIONTITLE() AS STRING
gMacroTHeader = "Get_Session_Title$() "
'---------- Return the formatted Window Title Bar text. Code taken from METHOD WindowTitle()
LOCAL TX AS ASCIIZ * 200, lText, lVer AS STRING
lVer = IIF$(ISNULL(Env.Title), "(v" + ENV.PgmVers + ")", "(" + ENV.Title + ")")
IF IsClip THEN ' CLIP mode?
TX = "CLIP - SPFLite" + lVer '
ELSEIF IsSetEdit THEN ' SETEdit mode?
TX = "SET-Edit - SPFLite" + lVer '
ELSEIF IsMEdit THEN ' Multi-Edit mode?
TX = "Multi-Edit - SPFLite" + lVer '
ELSEIF IsFMTab THEN ' File Manager?
IF ISNOTNULL(FileListNm) THEN ' Got a filelist name?
TX = FileListNm + " - FILELIST - File Manager - SPFLite" + lVer
ELSE '
TX = "File Manager - SPFLite" + lVer '
END IF '
ELSEIF TIP.FilePath = $Empty THEN ' FileTitle chosen?
TX = $Empty + " - SPFLite" + lVer '
ELSE '
lText = SWITCH$(IsBrowse, "BROWSE - ", IsView, "VIEW - ", %True, "EDIT - ")
TX = lText + TP.TIPFile + " - SPFLite" + lVer + " - " + TP.TIPFilePath
END IF '
FUNCTION = TX
QErrorNull ' ZRC = OK
DoTrace ' Do trace if needed
END FUNCTION