Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to hide executable code in VFP
Message
De
21/08/2019 12:27:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/08/2019 10:15:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01670203
Message ID:
01670215
Vues:
81
This may not be it but I have seen occasions that VFP doesn't really recompile when you even tell it to recompile in Project build. Since I have seen that, I have been explicitly recompiling all by code:
* rcompile.prg
Lparameters tcProjectName, tlNonVerbose
If !Empty(m.tcProjectName) And Type('_vfp.ActiveProject') = 'U'
  Modify Project (m.tcProjectName) Nowait
Endif

If Type('_vfp.ActiveProject') = 'U'
  Return
Endif
Set Notify off
LOCAL ix,totalFiles
ix = 0
totalFiles = 0
For Each loFile In _vfp.ActiveProject.Files
  If loFile.Type $ 'PKV'
  	totalFiles = m.totalFiles + 1
  ENDIF
endfor

? 'Total', m.totalFiles
For Each loFile In _vfp.ActiveProject.Files
  If !m.tlNonVerbose And loFile.Type $ 'PKV'
  	ix = m.ix + 1
  	? m.ix, loFile.Name
  Endif

  Do Case
    Case loFile.Type = 'P'
      Compile (loFile.Name)
    Case loFile.Type = 'K'
      Compile Form (loFile.Name)
    Case loFile.Type = 'V'
      Compile Classlib (loFile.Name)
      *!*   Case loFile.Type = 'R'
      *!*     Compile Report (loFile.Name)
  ENDCASE
Endfor
Set Notify on



>We came across an interesting "feature not a bug" in VFP today.
>
>I had a form where the tab stops were not working properly. I created a method on a parent class for the control on the form that was failing called tabstop_assign(). I added code at the form level to help diagnose where the TabStop property was being set. The code I added involved creating a temporary table populated with ASTACKINFO() info basically. It's a debug helper program I created called "debug_logme()" and records runtime information into memo fields for each instance it's called.
>
>I later deleted the tabstop_assign() method from the parent class and went about my life.
>
>However, the tabstop_assign() method code remained there on the form. It was not accessible in the designer / editor and no "tabstop_assign()" method showed up in the Methods tab. However, when that form was running it would still execute that hidden code. It called the tabstop_assign() method and running that code.
>
>The code was also searchable in VFP's Code Reference search tool, but when you clicked on the found item to bring up the designer / editor, it gave the message "Property was not found."
>
>-----
>VFP apparently uses two separate parsing engines or algorithms for code. One for the designer / editor, one for runtime assignment of method code.
>
>Might make an interesting drop-in class for Southwest Fox.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform