Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Today's work - all gone :(
Message
From
01/03/2007 08:38:46
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01199789
Message ID:
01199930
Views:
72
This message has been marked as the solution to the initial question of the thread.
Hi Naomi,

if you're not able to use Source Code control, look at using the hooks on the project manager to backup files every time you modify them. I'm sure there was an article in FPA or FoxTalk that gave you some code to do that.

Here is also some code that I got from cannot remember where/who that uses Winzip to back up all files in a project:
* this program zips up all files in the currently active project

*!*	m.lcFileName = _VFP.ActiveProject.Name + TRANSFORM(YEAR(DATE())) + TRANSFORM(MONTH(DATE())) + TRANSFORM(DAY(DATE())) + "_" + TRANSFORM(HOUR(DATETIME())) + TRANSFORM(MINUTE(DATETIME())) + TRANSFORM(SEC(DATETIME())) + ".zip"

lcClassPath = ADDBS(JUSTPATH( SYS(16) ))
?lcclasspath
DECLARE GetPrivateProfileString IN WIN32API STRING sectionName, STRING KeyName, STRING stdVal, STRING @BUFFER, INTEGER BufferLen, STRING IniName

lcBuffer = SPACE(255)
GetPrivateProfileString( [backupdir],'backupdir',"",@lcBuffer, LEN(lcBuffer), lcClassPath+"backup.ini")

IF NOT EMPTY( lcBuffer)
   lcBackupDir = ADDBS(STRTRAN( lcBuffer, CHR(0),""))
   IF NOT DIRECTORY( lcBackupDir)
      MD (lcBackupDir)
   ENDIF
ELSE
   lcBackupDir = ADDBS(FULLPATH(CURDIR()))
ENDIF

IF _VFP.ACTIVEPROJECT.FILES.COUNT > 0
   lcYear = ALLTRIM( STR( YEAR(DATE())))
   lcMonth = PADL(ALLTRIM( STR( MONTH(DATE()))),2,"0")
   lcDay = PADL(ALLTRIM( STR( DAY(DATE()))),2,"0")

   lcTempname = lcYear+lcMonth+lcDay
   lcTempname = lcTempname+"_"+CHRTRAN( TIME(), ":","")
   lcTempname = JUSTSTEM( _VFP.ACTIVEPROJECT.NAME)+lcTempname+"_Backup"


   lcZipFile = lcTempname+".zip"
   lcZipList = lcTempname+".lst"

   IF FILE( (lcZipFile) )
      ERASE (lcZipFile)
   ENDIF

   IF FILE( (lcZipList) )
      ERASE (lcZipList)
   ENDIF
   LOCAL loshell AS "wscript.shell"

   makelist(lcZipList)

   loshell = CREATEOBJECT("wscript.shell")
   loshell.RUN("winzip.exe -a -P -r "+m.lcBackUpDir+lcZipFile+" @"+lcZipList,2)
   INKEY(.5)

   ERASE (lcZipList)

   *   IF FILE( lcZipFile )
   *      RENAME (lcZipFile) to ((this.cBackUpDir)+lcZipFile)
   *   ENDIF

   RELEASE loshell

ENDIF


FUNCTION makelist
LPARAMETERS tcZipList
LOCAL lnHandle, loProject

loProject = _vfp.ActiveProject
lnHandle = FCREATE( (tcZipList))

FOR lnI = 1 TO loProject.FILES.COUNT
   lcFilePath = ADDBS( JUSTPATH( loProject.FILES[lnI].NAME))
   lcFileName = JUSTSTEM( loProject.FILES[lnI].NAME)
   lcFileExt  = UPPER(JUSTEXT( loProject.FILES[lnI].NAME))
   DO CASE
         * forms
      CASE lcFileExt = "SCX"
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         FPUTS( lnHandle, lcFilePath+lcFileName+".SCT" )
         * classlibs
      CASE lcFileExt = "VCX"
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         FPUTS( lnHandle, lcFilePath+lcFileName+".VCT" )

         * databasecontainers
      CASE lcFileExt = "DBC"
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         FPUTS( lnHandle, lcFilePath+lcFileName+".DCT" )
         FPUTS( lnHandle, lcFilePath+lcFileName+".DCX" )

         * reports
      CASE lcFileExt = "FRX"
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         FPUTS( lnHandle, lcFilePath+lcFileName+".FRT" )

         *labels
      CASE lcFileExt = "LBX"
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         FPUTS( lnHandle, lcFilePath+lcFileName+".LBT" )

         * database tables
      CASE lcFileExt = "DBF"
         *
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
         *
         IF FILE( lcFilePath+lcFileName+".CDX" )
            FPUTS( lnHandle, lcFilePath+lcFileName+".CDX")
         ENDIF
         *
         IF FILE( lcFilePath+lcFileName+".FPT" )
            FPUTS( lnHandle, lcFilePath+lcFileName+".FPT")
         ENDIF

         * any other file in the project
      OTHERWISE
         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
   ENDCASE

ENDFOR
FCLOSE( lnHandle )
>Hi everybody,
>
>Ok, I was doing a little work today in addition of browsing various web-sites <g>. At some point I wanted to run my form, got an error, made modifications, got distracted, the usual story...
>
>Anyway, instead of the form (form class) I now see formset in the classlibrary and I do not see the form at all.
>
>Needless to say I didn't do any backups today.
>
>Any way to get the form back? And no, I didn't compile the app either.
>
>Thanks in advance.
>
>Update. Ok, luckily I got it back (it was just deleted in class library), but all my changes are gone (no new buttons, no new code, nothing).
>
>Not the first time <g> I guess, I will write it better again.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform