Skip to content

Instantly share code, notes, and snippets.

@dkeza
Created March 14, 2018 10:09
Show Gist options
  • Save dkeza/3c0b99afa54c1955978ac5ac69f3b168 to your computer and use it in GitHub Desktop.
Save dkeza/3c0b99afa54c1955978ac5ac69f3b168 to your computer and use it in GitHub Desktop.
Call foxbin2prg.exe to create text / binary files in Visual FoxPro, and use it with Git/SVN
LPARAMETERS lp_cPJM
LOCAL l_cPJX, l_cRun, l_cParam
? "Run foxbin2prg.exe..."
IF EMPTY(lp_cPJM)
IF NOT (TYPE("_vfp.ActiveProject")="O" AND NOT ISNULL(_vfp.ActiveProject))
? "Error. Project file must be open!"
RETURN .F.
ENDIF
l_cPJX = _vfp.ActiveProject.Name
_vfp.ActiveProject.Close()
l_cParam = l_cPJX
ELSE
l_cParam = lp_cPJM
l_cPJX = FORCEEXT(lp_cPJM, "pjx")
ENDIF
l_cRun = [RUN foxbin2prg.exe "] + l_cParam + [" "*"]
&l_cRun
IF NOT EMPTY(l_cPJX) AND FILE(l_cPJX)
MODIFY PROJECT (l_cPJX) NOWAIT
ELSE
? "Error. No PJX file found!"
ENDIF
? "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment