Hi Wes,

If you don't need them to run, but want them for source control, FoxBin2Prg is 
a good tool for moving the VFP binary files to Text and back to Binaries. It 
will do it in a batch with one command.

If you need the prg to run the form after the fact, that's more of a challenge. 
The depth of controls, and code in events/methods on those controls can be 
tricky to connect from the form level.  There is also containers in other 
containers that have children. I haven't tinkered with moving an SCX to a 
functioning PRG in several years, but that's the two bits that recall having 
challenges with.

HTH,
Tracy


-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Peter 
Cushing
Sent: Thursday, May 30, 2019 9:35 AM
To: [email protected]
Subject: Re: Converting an SCX to a PRG in batch mode

Hi Wes,

I generate my forms to a .txt version that I can use to diff what has
changed.  It also does classes to a .txt file.  The program checks the
date/time of the .scx file and the .txt file (if it exists) and if the
text file is older or does not exist it will generate one use using
scctextx.prg which I think I got from the internet.  You could easily
change it to output a .prg in the call to scctextx.

Anyway here is my genform.prg:

* go through forms folder and check each form to see if the form
* date is later than the .txt file of the form or if the .txt file
* has not been generated yet.
LOCAL tModified,lOlder
LOCAL nTextfile
PRIVATE cHome
LOCAL ARRAY aForms[1],aTxtFile[1]
CLEAR
SET TALK off
cHome = "c:\ws\forms\"
DO processit WITH 'scx',"K"
* then classes
cHome = "c:\ws\classes\"
DO processit WITH 'vcx',"V"

RETURN
****************************************
FUNCTION processit
PARAMETERS cExt,cLetter
LOCAL nForms,i,cForm
? 'Processing: ' + cHome + ' for: ' + cExt
* first get a list of forms to process
nforms = ADIR(aForms,cHome + '*.'+cExt,'')

FOR i = 1 TO nForms
   cForm = JUSTSTEM(aForms[i,1])
   * now find out if no file or text file older
   tModified = CTOT(DTOC(aForms[i,3]) + ' ' + aForms[i,4])
   lOlder = .t.
   IF FILE(cHome + cForm + '.txt')
      nTextfile = ADIR(aTxtFile,cHome + cForm + '.txt','')
      IF nTextfile > 0
         IF tModified < CTOT(DTOC(aTxtFile[1,3]) + ' ' + aTxtFile[1,4])
            lOlder = .f.
         ENDIF
      ENDIF
   ENDIF
   IF lOlder
      ? 'Generating text file for ' + cForm
      DO (HOME() + 'scctextx') WITH cHome + cForm +
"."+cExt,cLetter,cHome + cForm + ".txt",.t.
   ENDIF
NEXT
CLOSE TABLES ALL
RETURN




Peter Cushing
IT Department
WHISPERING SMITH


On 22/05/2019 18:35, [email protected] wrote:
> Is there a way to convert a group of SCXs into PRGs in batch mode? I need to 
> do 400 of them.
> Google did not help.
> Thanks,Wes
> Wes Wilson, President
>   ERW Custom Programming, Inc. Crescent Lake Plaza
> 5459  Elizabeth Lake Rd.
> Waterford, MI 48327 
> (248) 683-4182 
> LinkedIn Profile
>
>  "Companies pay too much attention to the cost of doing something.  
> They should worry more about the cost of not doing it"  Philip Kotler
> www.erw.com [email protected]   
>
>     On Wednesday, May 22, 2019, 1:50:23 AM EDT, <[email protected]> 
> wrote:  
>  
>  Send ProFox mailing list submissions to
>     [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://mail.leafe.com/mailman/listinfo/profox
> or, via email, send a message with subject or body 'help' to
>     [email protected]
>
> You can reach the person managing the list at
>     [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ProFox digest..."
> Today's Topics:
>
>   1. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (MB Software Solutions, LLC)
>   2. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (Kurt @ Gmail)
>   3. Re: ? Cross tabulation (Ted Roche)
>   4. Re: ? Cross tabulation (Ted Roche)
>   5. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (Eric Selje)
>   6. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (MB Software Solutions, LLC)
>   7. Re: ? Cross tabulation (MB Software Solutions, LLC)
>   8. Re: Filtering Oddity (Gene Wirchenko)
>   9. Re: Filtering Oddity (Gene Wirchenko)
>   10. Re: Filtering Oddity (Gene Wirchenko)
>   11. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (Gene Wirchenko)
>   12. Re: Filtering Oddity (AndyHC)
>   13. Re: [NF] Cursing Microsoft for dialog boxes that will not
>       expand in any direction in Word 2016 (Kurt @ Gmail)
> Ouch...that gives me a headache just trying to decipher that!
>
>
> On 5/21/2019 4:36 AM, Johan Nel wrote:
>> And straight from the .NET runtime, the culprit is....  drum 
>> rolling......  BestFitMapping = false :-)
>>
>> [DllImport("user32.dll", BestFitMapping = false, CharSet = 
>> CharSet.Auto, SetLastError = true)]
>> [SuppressUnmanagedCodeSecurity]
>> [SecurityCritical]
>> public static extern int MessageBox(HandleRef hWnd, string text, 
>> string caption, int type);
>>
>> On 2019/05/20 23:52, MB Software Solutions, LLC wrote:
>>> GRRRRRR!!!!! I've got a colossal cleanup to do with bookmark 
>>> references and this freaking window refuses to enlarge in any 
>>> direction: https://www.screencast.com/t/PTDtv8bVI
>>>
>>> C'MON, M$!!!  NOT TODAY!!!!!
>>>
>>>
>>> ---
>>> This email has been checked for viruses by Avast antivirus software.
>>> https://www.avast.com/antivirus
>>>
>>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to