sync SVN r17882
This commit is contained in:
131
docs/inrolare-proiect-git-text.md
Normal file
131
docs/inrolare-proiect-git-text.md
Normal file
@@ -0,0 +1,131 @@
|
||||
# Inrolarea unui proiect ROA (Visual FoxPro) in fluxul git-text FoxBin2Prg
|
||||
|
||||
Instructiuni pas cu pas pentru o sesiune Claude Code care inroleaza un proiect ROA
|
||||
in fluxul in care git urmareste DOAR versiunile text FoxBin2Prg (.vc2/.sc2/.fr2/.mn2/
|
||||
.lb2/.pj2/.dc2/.db2) generate in arbore, langa binarele VFP. SVN ramane sursa de
|
||||
adevar si nu se atinge (niciun svn commit fara acordul explicit al utilizatorului).
|
||||
|
||||
Proiecte deja inrolate (16.07.2026): ROACONT, ROAGEST, ROAAUTO, ROAIMOB, ROAACNPRO,
|
||||
ROAFACTURARE + COMUN (romfast/comun.git). Modelul de referinta este ROACONT.
|
||||
|
||||
## Reguli pentru sesiunea care executa
|
||||
|
||||
- Foloseste EXCLUSIV PowerShell pentru comenzi (NU tool-ul Bash — bash.exe crapa pe
|
||||
aceste masini si lasa stackdump-uri).
|
||||
- NU face niciun `svn commit`. NU modifica binarele VFP. La final binarele trebuie sa
|
||||
fie byte-identice (verificabil cu `svn status`: niciun binar M).
|
||||
- Rularile de conversie dureaza zeci de minute pe proiecte mari: sunt incrementale,
|
||||
daca expira timeout-ul tool-ului se reiau pana la capat.
|
||||
- Nu rula doua conversii git_sync in paralel pe acelasi arbore.
|
||||
|
||||
## Preconditii
|
||||
|
||||
1. Tooling-ul partajat exista in `D:\ROA\UTIL\foxbin2prg\`: `git_sync.ps1`,
|
||||
`vfp_filemap.ps1`, `txt2vcx.ps1`, `roa_sync.ps1`, `test_git_sync.ps1`,
|
||||
`test_roundtrip.ps1`. Citeste-le inainte (macar help-ul din git_sync.ps1).
|
||||
2. Proiectul e working copy SVN valid (`svn info D:\ROA\<PROIECT>`), cu `COMUN\`
|
||||
inauntru (external SVN).
|
||||
3. Repo-ul gitea exista: `git ls-remote git@gitea.romfast.ro:romfast/<proiect>.git`.
|
||||
Daca nu exista, cere utilizatorului sa-l creeze din interfata gitea (NU crea
|
||||
repo-uri prin API din proprie initiativa).
|
||||
4. SVN global-ignores pe masina contine `*.vc2 *.sc2 *.fr2 *.mn2 *.lb2 *.pj2 *.dc2
|
||||
*.db2 *.dbf.cfg` (in `%APPDATA%\Subversion\config`, sectiunea [miscellany]).
|
||||
Fara asta, textele apar ca `?` in svn status si risca svn add accidental.
|
||||
5. Daca proiectul ARE deja git cu istoric si urmeaza reset: confirmarea utilizatorului
|
||||
ca nu exista clone active pe alte masini (force-push rescrie istoria).
|
||||
|
||||
## Pasi
|
||||
|
||||
### 1. Inventar prealabil (inainte de orice stergere)
|
||||
|
||||
- Exista `.git`? Noteaza `git remote -v` si branch-ul. Exista `COMUN\.git`?
|
||||
- `git ls-files *.dbf` (daca exista repo vechi): tabelele urmarite azi ca binare sunt
|
||||
candidate la conversie .db2 (cerinta: tot ce e convertibil trece pe text).
|
||||
|
||||
### 2. Conversia completa
|
||||
|
||||
```powershell
|
||||
& D:\ROA\UTIL\foxbin2prg\git_sync.ps1 -ProjectRoot D:\ROA\<PROIECT>
|
||||
```
|
||||
|
||||
- DbfList implicit acopera `Locale\locale*.dbf`, `Help\*.dbf`, `DATE\Optiuni_*.dbf`
|
||||
si toate dbf-urile COMUN. Tabele de configurare specifice proiectului se adauga cu
|
||||
`-DbfList` explicit (ATENTIE: parametrii array NU se pot pasa prin
|
||||
`powershell -File` — invoca scriptul in-process cu `&`, altfel array-ul se
|
||||
colapseaza). Tabele operationale mari nu se adauga; un .db2 peste 5 MB ramane binar.
|
||||
- Esecuri de conversie — se investigheaza fiecare:
|
||||
- meniuri pre-VFP9 ("NOT in VFP 9 Format"): raman binare, cu exceptii negate `!` in
|
||||
.gitignore; intra in flux doar dupa re-salvare in VFP9 (MODIFY MENU -> save);
|
||||
- clase FFC/third-party cu roundtrip fals-negativ (#INCLUDE lipsa in staging izolat,
|
||||
ex. cele 6 din COMUN deja scutite implicit): se adauga la `-RoundtripExempt`;
|
||||
- alte esecuri reale: fisierul ramane binar urmarit (exceptie `!`) si se raporteaza.
|
||||
- Regula: nu se trece mai departe cu esecuri neexplicate (exit code nenul).
|
||||
|
||||
### 3. .gitignore si .gitattributes
|
||||
|
||||
- Copiaza `D:\ROA\ROACONT\.gitignore` ca model si adapteaza: sectiunea machine-local
|
||||
(exe-ul proiectului, <proiect>_ref.DBF/FPT/CDX, FOXUSER, .ini/.ARM, log-uri) si
|
||||
sectiunea dbf: fiecare .dbf care are .db2 se ignora INDIVIDUAL (plus .fpt-ul lui).
|
||||
NU ignora: `*.??2`, `*.dbf.cfg`, grafica (bmp/ico/jpg/png), ocx, tmpl.
|
||||
- `.gitattributes` cu `* -text` (SVN ramane autoritatea EOL; git nu normalizeaza).
|
||||
|
||||
### 4. Init/reset repo proiect
|
||||
|
||||
```powershell
|
||||
# doar la reset: Remove-Item -Recurse -Force D:\ROA\<PROIECT>\.git
|
||||
git -C D:\ROA\<PROIECT> init -b main
|
||||
git -C D:\ROA\<PROIECT> remote add origin git@gitea.romfast.ro:romfast/<proiect>.git
|
||||
git -C D:\ROA\<PROIECT> add -A
|
||||
```
|
||||
|
||||
VERIFICARE OBLIGATORIE inainte de commit (`git ls-files` pe staged):
|
||||
- 0 binare convertibile urmarite (vcx/vct/scx/sct/frx/frt/mnx/mnt/lbx/lbt/pjx/pjt/
|
||||
dbc/dct/cdx/dcx), cu exceptia celor cu `!` justificate;
|
||||
- textele .??2 prezente; 0 fisiere din COMUN/ (are repo-ul lui).
|
||||
|
||||
Commit: `Initial: flux text FoxBin2Prg (git urmareste .??2 in-arbore, binarele VFP
|
||||
git-ignored)` + linia Co-Authored-By a sesiunii. Push: `git push -u origin main`
|
||||
(`--force` doar la reset).
|
||||
|
||||
### 5. Clona COMUN a proiectului
|
||||
|
||||
```powershell
|
||||
# daca exista .git vechi: Remove-Item -Recurse -Force D:\ROA\<PROIECT>\COMUN\.git
|
||||
git -C D:\ROA\<PROIECT>\COMUN init -b main
|
||||
git -C D:\ROA\<PROIECT>\COMUN remote add origin git@gitea.romfast.ro:romfast/comun.git
|
||||
git -C D:\ROA\<PROIECT>\COMUN fetch origin
|
||||
git -C D:\ROA\<PROIECT>\COMUN reset origin/main # mixed: pastreaza discul
|
||||
git -C D:\ROA\<PROIECT>\COMUN checkout origin/main -- .gitignore
|
||||
```
|
||||
|
||||
Diferentele ramase in `git status` = revizii SVN diferite ale clonei (normal).
|
||||
NU comite nimic in comun.git dintr-o clona decalata — comun se comite doar din clona
|
||||
in care s-a lucrat efectiv, dupa svn update.
|
||||
|
||||
### 6. roa_sync.bat
|
||||
|
||||
Copiaza `D:\ROA\ROACONT\roa_sync.bat` in radacina proiectului (e generic, foloseste
|
||||
`%~dp0`) si include-l in commit. Utilizatorul il ruleaza la inceput de sesiune:
|
||||
svn update -> git_sync -> commit "sync SVN rN" pe main (proiect + COMUN) -> inchide
|
||||
branch-urile claude/* cu diff gol.
|
||||
|
||||
### 7. Verificari finale
|
||||
|
||||
- Acoperire: fiecare binar convertibil din arbore (inclusiv COMUN) are text .??2
|
||||
langa el (exceptiile `!` enumerate si justificate).
|
||||
- `svn status`: niciun binar modificat, niciun .??2 adaugat in SVN.
|
||||
- `git ls-remote origin main` = HEAD-ul local.
|
||||
- Raport final: numar texte per tip, esecuri/scutiri, commit hash, push status.
|
||||
|
||||
## Note operationale
|
||||
|
||||
- Dialogurile modale FoxBin2Prg sunt suprimate de scripturi printr-un `foxbin2prg.cfg`
|
||||
cu `DontShowErrors: 1` scris per-director de staging (cfg-ul global de langa exe NU
|
||||
e fiabil). Daca utilizatorul vede totusi un MessageBox, e un dialog nativ VFP —
|
||||
watchdog-ul din Invoke-FoxBin2PrgSafe il omoara la timeout.
|
||||
- Tabelele legate de un DBC au nevoie de .dbc/.dct/.dcx si .cdx langa ele la conversie
|
||||
(git_sync face asta automat in staging).
|
||||
- `DBF_Conversion_Support: 4` (scris de git_sync in cfg-ul de staging) exporta DATELE
|
||||
in .db2, nu doar structura.
|
||||
- Fisierele doar-git (docs, .bat, .gitignore) se comit separat, inainte de sync-ul
|
||||
"sync SVN rN", altfel nimeresc in commit-ul de sincronizare.
|
||||
388
utile/barcode/foxbarcodeqr.prg
Normal file
388
utile/barcode/foxbarcodeqr.prg
Normal file
@@ -0,0 +1,388 @@
|
||||
*--------------------------------------------------------------------------------------
|
||||
* FoxBarcodeQR.prg
|
||||
*--------------------------------------------------------------------------------------
|
||||
* FoxBarcodeQR is a application free software and offers a Barcode tool for the Visual
|
||||
* FoxPro Community. This is a supplement of FoxBarcode class only for QR Code barcodes.
|
||||
* This software is provided "as is" without express or implied warranty.
|
||||
* Use it at your own risk
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Version: 2.10
|
||||
* Date : 2021.02.27
|
||||
* Author : VFPEncoding
|
||||
* Email : vfpencoding@gmail.com
|
||||
*
|
||||
* Note : VFPEncoding are
|
||||
* Guillermo Carrero (QEPD) (Barcelona, Spain) and
|
||||
* Luis Maria Guayan (Tucuman, Argentina)
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Note : This application use the libraries
|
||||
* BarCodeLibrary.dll (by: Dario Alvarez Aranda, Mexico)
|
||||
* QRCodeLib.dll (visit: www.validacfd.com)
|
||||
* Google API - https://developers.google.com/chart/infographics/docs/qr_codes
|
||||
*--------------------------------------------------------------------------------------
|
||||
|
||||
*--------------------------------------------------------------------------------------
|
||||
* FoxBarcodeQR Class Definition
|
||||
*--------------------------------------------------------------------------------------
|
||||
DEFINE CLASS FoxBarcodeQR AS CUSTOM
|
||||
|
||||
m.cTempPath = "" && Windows Temp folder + SYS(2015)
|
||||
m.cAppPath = "" && App folder
|
||||
m.lDeleteTempFiles = .T. && Delete the temporary folder and image files
|
||||
|
||||
m.nVersion = 2.10 && Version
|
||||
m.lAutoConfigurate = .T.
|
||||
m.lAutoFit = .F.
|
||||
m.nBackColor = RGB(255, 255, 255) && White
|
||||
m.nBarColor = RGB(0, 0, 0) && Black
|
||||
m.nCorrectionLevel = 1 && 0-[L]ow 7%, 1-[M]edium 15%, 2-[Q]uartile 25%, 3-[H]igh 30%]
|
||||
m.nEncoding = 4 && Automatic encoding algorithm
|
||||
m.nMarginPixels = 0 && pixels
|
||||
m.nModuleWidth = 2 && pixels
|
||||
m.nHeight = 132 && pixels
|
||||
m.nWidth = 132 && pixels
|
||||
m.nSize = 132 && pixels
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE QRBarcodeImage()
|
||||
*---------------------------------------------------------
|
||||
* Generated QR Barcode image with BarCodeLibrary.dll
|
||||
* Parameters:
|
||||
* tcText: Text to encode
|
||||
* tcFile: Imagen File Name (optional)
|
||||
* tnSize: Imagen Size [2..12] (default = 4)
|
||||
* (Width in pixels is tnSize x 33 pixels)
|
||||
* (tnSize = 4 -> 132 x 132 pixels)
|
||||
* tnType: Imagen Type [BMP, JPG or PNG] (default = 0)
|
||||
* 0 = BMP
|
||||
* 1 = JPG
|
||||
* 2 = PNG
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE QRBarcodeImage(tcText, tcFile, tnSize, tnType)
|
||||
LOCAL lcType, lcFolder
|
||||
|
||||
IF VARTYPE(m.tnSize) <> "N"
|
||||
m.tnSize = INT(THIS.nSize / 33) && default size: 132 x 132 pixels
|
||||
ENDIF
|
||||
|
||||
IF VARTYPE(m.tnType) <> "N"
|
||||
m.tnType = 0 && defaul type: BMP
|
||||
ENDIF
|
||||
|
||||
m.tnSize = MIN(MAX(m.tnSize, 2), 12)
|
||||
m.tnType = MIN(MAX(m.tnType, 0), 2)
|
||||
m.lcType = IIF(m.tnType = 1, "JPG", IIF(m.tnType = 2, "PNG", "BMP"))
|
||||
|
||||
IF EMPTY(m.tcFile)
|
||||
m.lcFolder = THIS.cTempPath
|
||||
IF NOT DIRECTORY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.lcFolder + SYS(2015), m.lcType)
|
||||
ELSE
|
||||
m.lcFolder = JUSTPATH(m.tcFile)
|
||||
IF NOT DIRECTORY(m.lcFolder) AND NOT EMPTY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.tcFile, m.lcType)
|
||||
ENDIF
|
||||
|
||||
*-- Declare the functions of BarCodeLibrary.dll
|
||||
DECLARE INTEGER GenerateFile IN "BarCodeLibrary.dll" ;
|
||||
STRING cData, STRING cFileName
|
||||
|
||||
DECLARE INTEGER SetConfiguration IN "BarCodeLibrary.dll" ;
|
||||
INTEGER nSize, INTEGER nImageType
|
||||
|
||||
SetConfiguration(m.tnSize, m.tnType)
|
||||
GenerateFile(m.tcText, m.tcFile)
|
||||
|
||||
CLEAR DLLS "SetConfiguration", "GenerateFile"
|
||||
|
||||
RETURN m.tcFile
|
||||
ENDPROC
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE FullQRCodeImage()
|
||||
*---------------------------------------------------------
|
||||
* Generated QR Barcode image with QRCodeLib.dll (visit: www.validacfd.com)
|
||||
* Parameters:
|
||||
* tcText: Text to encode
|
||||
* tcFile: Imagen File Name (optional)
|
||||
* tnSize: Imagen Size in pixels
|
||||
* tnType: Imagen Type [Only 0=BMP]
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE FullQRCodeImage(tcText, tcFile, tnSize, tnType)
|
||||
LOCAL lcType, lcFolder
|
||||
|
||||
IF VARTYPE(m.tnSize) <> "N"
|
||||
m.tnSize = THIS.nSize
|
||||
ENDIF
|
||||
m.tnSize = MIN(MAX(m.tnSize, 64), 1280)
|
||||
STORE m.tnSize TO THIS.nHeight, THIS.nWidth
|
||||
|
||||
*-- Only BMP type
|
||||
m.tnType = 0
|
||||
m.lcType = "BMP"
|
||||
|
||||
IF EMPTY(m.tcFile)
|
||||
m.lcFolder = THIS.cTempPath
|
||||
IF NOT DIRECTORY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.lcFolder + SYS(2015), m.lcType)
|
||||
ELSE
|
||||
m.lcFolder = JUSTPATH(m.tcFile)
|
||||
IF NOT DIRECTORY(m.lcFolder) AND NOT EMPTY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.tcFile, m.lcType)
|
||||
ENDIF
|
||||
CLEAR RESOURCES m.tcFile
|
||||
|
||||
*-- Declare the functions of QRCodeLib.dll (visit: www.validacfd.com)
|
||||
DECLARE FullQRCode IN "QRCodeLib.dll" ;
|
||||
INTEGER lAutoConfigurate, ;
|
||||
INTEGER lAutoFit, ;
|
||||
LONG nBackColor, ;
|
||||
LONG nBarColor, ;
|
||||
STRING cText, ;
|
||||
INTEGER nCorrectionLevel, ;
|
||||
INTEGER nEncoding, ;
|
||||
INTEGER nMarginPixels, ;
|
||||
INTEGER nModuleWidth, ;
|
||||
INTEGER nHeight, ;
|
||||
INTEGER nWidth, ;
|
||||
STRING cFileName
|
||||
|
||||
FullQRCode(THIS.lAutoConfigurate, THIS.lAutoFit, THIS.nBackColor, THIS.nBarColor, ;
|
||||
m.tcText, THIS.nCorrectionLevel, THIS.nEncoding, THIS.nMarginPixels, ;
|
||||
THIS.nModuleWidth, THIS.nHeight, THIS.nWidth, m.tcFile)
|
||||
|
||||
CLEAR DLLS "FullQRCode"
|
||||
|
||||
RETURN m.tcFile
|
||||
ENDPROC
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE FastQRCodeImage()
|
||||
*---------------------------------------------------------
|
||||
* Generated QR Barcode image with QRCodeLib.dll (visit: www.validacfd.com)
|
||||
* Parameters:
|
||||
* tcText: Text to encode
|
||||
* tcFile: Imagen File Name (optional)
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE FastQRCodeImage(tcText, tcFile)
|
||||
LOCAL lcFolder, lcType
|
||||
|
||||
*-- Only BMP type
|
||||
m.lcType = "BMP"
|
||||
|
||||
IF EMPTY(m.tcFile)
|
||||
m.lcFolder = THIS.cTempPath
|
||||
IF NOT DIRECTORY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.lcFolder + SYS(2015), m.lcType)
|
||||
ELSE
|
||||
m.lcFolder = JUSTPATH(m.tcFile)
|
||||
IF NOT DIRECTORY(m.lcFolder) AND NOT EMPTY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.tcFile, m.lcType)
|
||||
ENDIF
|
||||
CLEAR RESOURCES m.tcFile
|
||||
|
||||
*-- Declare the functions of QRCodeLib.dll (visit: www.validacfd.com)
|
||||
DECLARE FastQRCode IN "QRCodeLib.dll" ;
|
||||
STRING cText, ;
|
||||
STRING cFileName
|
||||
|
||||
FastQRCode(m.tcText, m.tcFile)
|
||||
|
||||
CLEAR DLLS "FastQRCode"
|
||||
|
||||
RETURN m.tcFile
|
||||
ENDPROC
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE GooQRCodeImage()
|
||||
*---------------------------------------------------------
|
||||
* Generated QR Barcode image with Google API (requires internet connection)
|
||||
* https://developers.google.com/chart/infographics/docs/qr_codes
|
||||
* Parametes:
|
||||
* tcText: Text to encode
|
||||
* tcFile: Imagen File Name (optional)
|
||||
* tnSize: Imagen Size in pixels
|
||||
* tnType: Imagen Type [Only 2=PNG]
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE GooQRCodeImage(tcText, tcFile, tnSize, tnType)
|
||||
LOCAL lcType, lcFolder, lcUrl, lcCorrection, lnMargin
|
||||
|
||||
IF VARTYPE(m.tnSize) <> "N"
|
||||
m.tnSize = THIS.nSize && Defaul size = 132 x 132 pixels
|
||||
ENDIF
|
||||
|
||||
m.tnSize = MIN(MAX(m.tnSize, 72), 540)
|
||||
m.lnMargin = MIN(MAX(THIS.nMarginPixels, 0), 10)
|
||||
|
||||
*-- Only PNG type
|
||||
m.tnType = 2
|
||||
m.lcType = "PNG"
|
||||
|
||||
IF EMPTY(m.tcFile)
|
||||
m.lcFolder = THIS.cTempPath
|
||||
IF NOT DIRECTORY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.lcFolder + SYS(2015), m.lcType)
|
||||
ELSE
|
||||
m.lcFolder = JUSTPATH(m.tcFile)
|
||||
IF NOT DIRECTORY(m.lcFolder) AND NOT EMPTY(m.lcFolder)
|
||||
MD (m.lcFolder)
|
||||
ENDIF
|
||||
m.tcFile = FORCEEXT(m.tcFile, m.lcType)
|
||||
ENDIF
|
||||
CLEAR RESOURCES m.tcFile
|
||||
|
||||
m.lcCorrection = SUBSTR([LMQH], THIS.nCorrectionLevel + 1, 1)
|
||||
IF EMPTY(m.lcCorrection)
|
||||
m.lcCorrection = [M] && Default
|
||||
ENDIF
|
||||
|
||||
m.lcUrl = [https://chart.googleapis.com/chart?cht=qr] + ;
|
||||
[&chs=] + TRANSFORM(m.tnSize) + [x] + TRANSFORM(m.tnSize) + ;
|
||||
[&chld=] + m.lcCorrection + [|] + TRANSFORM(m.lnMargin) + ;
|
||||
[&chl=] + m.tcText
|
||||
|
||||
*-- Declare URLDownloadToFile function
|
||||
DECLARE LONG URLDownloadToFile IN URLMON.DLL ;
|
||||
LONG, STRING, STRING, LONG, LONG
|
||||
|
||||
ERASE (m.tcFile)
|
||||
IF 0 = URLDownloadToFile(0, m.lcUrl, m.tcFile, 0, 0)
|
||||
RETURN m.tcFile
|
||||
ELSE
|
||||
RETURN ""
|
||||
ENDIF
|
||||
ENDPROC
|
||||
|
||||
*------------------------------------------------------
|
||||
* PROCEDURE QRCodeVersion()
|
||||
*------------------------------------------------------
|
||||
* Returns the version of the QRCodeLib.dll library
|
||||
*------------------------------------------------------
|
||||
PROCEDURE QRCodeVersion()
|
||||
LOCAL lcVersion
|
||||
DECLARE STRING QRCodeLibVer IN "QRCodeLib.dll"
|
||||
m.lcVersion = QRCodeLibVer()
|
||||
CLEAR DLLS "QRCodeLibVer"
|
||||
RETURN m.lcVersion
|
||||
ENDPROC
|
||||
|
||||
*------------------------------------------------------
|
||||
* PROCEDURE QRBarcodeVersion()
|
||||
*------------------------------------------------------
|
||||
* Returns the version of the BarCodeLibrary.dll library
|
||||
*------------------------------------------------------
|
||||
PROCEDURE QRBarcodeVersion()
|
||||
LOCAL lcVersion
|
||||
DECLARE INTEGER LibraryVersion IN "BarCodeLibrary.dll"
|
||||
m.lcVersion = LibraryVersion()
|
||||
CLEAR DLLS "LibraryVersion"
|
||||
RETURN m.lcVersion
|
||||
ENDPROC
|
||||
|
||||
*------------------------------------------------------
|
||||
* PROCEDURE Init()
|
||||
*------------------------------------------------------
|
||||
PROCEDURE INIT()
|
||||
THIS.cTempPath = ADDBS(THIS.TempPath() + SYS(2015))
|
||||
THIS.cAppPath = FULLPATH("")
|
||||
STORE THIS.nSize TO THIS.nHeight, THIS.nWidth
|
||||
ENDPROC
|
||||
|
||||
*------------------------------------------------------
|
||||
* PROCEDURE Destroy()
|
||||
*------------------------------------------------------
|
||||
PROCEDURE DESTROY()
|
||||
IF THIS.lDeleteTempFiles
|
||||
THIS.EmptyFolder(THIS.cTempPath)
|
||||
IF DIRECTORY(THIS.cTempPath)
|
||||
RD (THIS.cTempPath)
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDPROC
|
||||
|
||||
*------------------------------------------------------
|
||||
* PROCEDURE EmptyFolder(tcFolder)
|
||||
*------------------------------------------------------
|
||||
* Empty temporary image folder
|
||||
*------------------------------------------------------
|
||||
PROCEDURE EmptyFolder(tcFolder)
|
||||
LOCAL loFso AS OBJECT
|
||||
LOCAL lcMask
|
||||
DO CASE
|
||||
CASE EMPTY(m.tcFolder)
|
||||
RETURN .F.
|
||||
CASE NOT DIRECTORY(m.tcFolder)
|
||||
RETURN .F.
|
||||
ENDCASE
|
||||
m.lcMask = ADDBS(m.tcFolder) + "*.*"
|
||||
#IF .T. && Use FSO
|
||||
m.loFso = CREATEOBJECT("Scripting.FileSystemObject")
|
||||
m.loFso.DeleteFile(m.lcMask, .T.)
|
||||
#ELSE && Not Use FSO
|
||||
ERASE (m.lcMask)
|
||||
#ENDIF
|
||||
RETURN .T.
|
||||
ENDPROC
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE TempPath()
|
||||
*---------------------------------------------------------
|
||||
* Returns the path for temporary files
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE TempPath()
|
||||
LOCAL lcPath, lnRet
|
||||
LOCAL lnSize
|
||||
m.lcPath = SPACE(255)
|
||||
m.lnSize = 255
|
||||
DECLARE INTEGER GetTempPath IN WIN32API ;
|
||||
INTEGER nBufSize, ;
|
||||
STRING @cPathName
|
||||
m.lnRet = GetTempPath(m.lnSize, @m.lcPath)
|
||||
IF m.lnRet <= 0
|
||||
m.lcPath = ADDBS(FULLPATH("TEMP"))
|
||||
ELSE
|
||||
m.lcPath = ADDBS(SUBSTR(m.lcPath, 1, m.lnRet))
|
||||
ENDIF
|
||||
RETURN m.lcPath
|
||||
ENDPROC
|
||||
|
||||
*---------------------------------------------------------
|
||||
* PROCEDURE Error
|
||||
*---------------------------------------------------------
|
||||
* Error procedure
|
||||
*---------------------------------------------------------
|
||||
PROCEDURE ERROR
|
||||
LPARAMETERS nError, cMethod, nLine
|
||||
LOCAL lcErrMsg
|
||||
LOCAL la[1]
|
||||
AERROR(la)
|
||||
m.lcErrMsg = "Error number: " + TRANSFORM(m.la(1, 1)) + CHR(13) + ;
|
||||
"Error message: " + m.la(1, 2) + CHR(13) + CHR(13) + ;
|
||||
"Method: " + m.cMethod + CHR(13) + ;
|
||||
"Line: " + TRANSFORM(m.nLine)
|
||||
MESSAGEBOX(m.lcErrMsg, 0 + 16, "FoxBarcodeQR error")
|
||||
ENDPROC
|
||||
|
||||
ENDDEFINE && FoxBarcodeQR
|
||||
|
||||
*--------------------------------------------------------------------------------------
|
||||
* END DEFINE FoxBarcodeQR Class
|
||||
*--------------------------------------------------------------------------------------
|
||||
|
||||
*--------------------------------------------------------------------------------------
|
||||
* End FoxBarcodeQR.prg
|
||||
*--------------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user