low hanging fruit... ahem functions
Posted: Thu Oct 24, 2019 3:29 am
Johan told me it was ok to "implement" such stuff when reading code and thinking of a vfp function with a different name. Therefore:
OUT in Parameter declaration is not the vfp way - sadly, I find it safer and easier to read than @in calling line
You can expect some equally taxing Force...functions in a few H - already done, but want to look them over on empty strings and such pesky stuff when I return.
HTH
thomas
Code: Select all
LOCAL lcPathedFile AS STRING
lcPath = "d:xS"
lcPathedFile = lcPath + "RootPlay.dbf"
? JustExt(lcPathedFile)
? JustStem(lcPathedFile)
? JustPath(lcPathedFile)
? JustDisk(lcPathedFile)
LOCAL loEmp
* LOCAL loEmp AS OBJECT
* loEmp = createobject("custom")
*-- nope, not yet
? "Press Exit Key"
RETURN
FUNCTION ByRef(tnChange OUT INT) AS Boolean
tnChange = IiF (tnChange = 42, -42, 42)
RETURN .t.
FUNCTION JustDisk (tcURI AS STRING) AS STRING
LOCAL lcDisk AS STRING
LOCAL lcDummy AS STRING
= _SplitPath(tcURI, OUT lcDisk, OUT lcDummy, OUT lcDummy, OUT lcDummy)
RETURN lcDisk
FUNCTION JustPath (tcURI AS STRING) AS STRING
LOCAL lcPath AS STRING
LOCAL lcDummy AS STRING
= _SplitPath(tcURI, OUT lcDummy, OUT lcPath, OUT lcDummy, OUT lcDummy)
RETURN lcPath
FUNCTION JustStem (tcURI AS STRING) AS STRING
LOCAL lcStem AS STRING
LOCAL lcDummy AS STRING
= _SplitPath(tcURI, OUT lcDummy, OUT lcDummy, OUT lcStem, OUT lcDummy)
RETURN lcStem
FUNCTION JustExt (tcURI AS STRING) AS STRING
LOCAL lcExt AS STRING
LOCAL lcDummy AS STRING
= _SplitPath(tcURI, OUT lcDummy, OUT lcDummy, OUT lcDummy, OUT lcExt)
RETURN lcExt
OUT in Parameter declaration is not the vfp way - sadly, I find it safer and easier to read than @in calling line
You can expect some equally taxing Force...functions in a few H - already done, but want to look them over on empty strings and such pesky stuff when I return.
HTH
thomas