Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Beautify
Message
 
À
29/02/2000 18:31:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00339467
Message ID:
00339581
Vues:
16
>You can call Beautify.app, but doing so produces errors, because apparently the program recieves parameters that we have no way of deciphering. This is one of the .app programs that VFP does not include source code for.

This is undocumented information.
Use it at your own risk.
*-- Sample code with the information for directly calling Beatify.app
Local cinputfile, coptions, coutputfile, obopt

cinputfile = 'testbeautyfy.prg'

*-- Beautify options object
obopt = CreateObject('beautyfyopt')
obopt.keywordcap = 1
obopt.identspace = 2

*-- Get the string of options
coptions = obopt.GetOptionsStr()
*-- Call beautify.app
coutputfile = Beautify(cinputfile, coptions)

*-- View the result of beautify (temporary file)
Modify command (coutputfile)
Return

*-- Define the options required by beautify.app
Define Class BeautyfyOpt As Custom

  *-- 1-Upper case, 2-Lowercase, 3-Match first, 4-Nochange
  symbolscap = 3

  *-- 1-Uppercase, 2-Lower case, 3-Mixed Case, 4-No change
  keywordcap = 3

  identspace = 4

  *-- 1-tabs, 2-space, 3-nochange
  typeofident = 2

  identcomments = .f.
  identcontinuation = .t.
  extraidentproc = .f.
  extraidentdocase = .f.

  Function GetOptionsStr
    Local cstropt

    cstropt = Replicate(chr(0), 36)

    cstropt = stuff(cstropt, 1, 1, chr(this.symbolscap))
    cstropt = stuff(cstropt,  5, 1, chr(this.keywordcap))
    cstropt = stuff(cstropt,  9, 1, chr(this.identspace))
    cstropt = stuff(cstropt, 13, 1, chr(this.typeofident))
    cstropt = stuff(cstropt, 21, 1, chr(iif(this.identcomments,1,0)))
    cstropt = stuff(cstropt, 25, 1, chr(iif(this.identcontinuation,1,0)))
    cstropt = stuff(cstropt, 29, 1, chr(iif(this.extraidentproc,1,0)))
    cstropt = stuff(cstropt, 33, 1, chr(iif(this.extraidentdocase,1,0)))

    Return cstropt
  EndFunc

EndDefine

Just an opinion... Not a fact.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform