Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Beautify programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00660261
Message ID:
00662791
Vues:
41
After some experimenting, I got it working.
* Saved options from my beautify settings
lcOptions = FILETOSTR("bt_opt.txt")
Set Procedure to (HOME()+ "beautify.app")
lcNewfile = Beautify( "bt_test.prg", lcOptions )
The lcNewfile variable holds the name of the temp file with formated code. If you get back file with unformated code than I would suspect that the options you're passing are incorrect. Just in case, I tested it under VFP7SP1.


>Sergey,
>
>I simply ran the Beautify option from the tools menu. Blank out all the settings and run it with a breakpoint set. Then set the options and repeat. This helps you figure out what they mean, etc. But even if I use a "fake" set of options that I gleaned via this method, I still can't figure out where to go to get the nicely formatted code.
>
>Any ideas? No one in the world seems to know either....
>
>Thanks,
>
>Fletcher
>
>>Where did you find about the second parameter? What values does it accept?
>>
>>>Hi all,
>>>
>>>I want to call _Beautify programatically. I know I can do the following:
>>>
>>>do (_beautify) with "junk.txt", lcOptions
>>>
>>>where lcOptions is a binary character string of values. Unfortunately, while this seems to run fine, I can't find an output file with the formatted code.
>>>
>>>So I tried the following code (with junk.txt containing code to be formatted):
>>>
>>>Set Path to JustPath(_beautify)
>>>Set Procedure to beautify.app
>>>? beautify("junk.txt", zzz)
>>>* returns a temp file name. But that is
>>>* the source file, not formatted file....
>>>aa = beautify("junk.txt", zzz)
>>>? aa
>>>
>>>In further analysis, it appears that it does try to create an object OX based on the beautify class. Unfortunately, I can't get it to let me create that class. I have tried to set the library and procedure to the beautify.app, but to no avail.
>>>
>>>Any ideas on how to call _beautify such that you can get the formatted code? What about the options settings?
>>>
>>>Thanks,
>>>
>>>Fletcher
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform