Converting Form to PRG 
Author Message
 Converting Form to PRG

Is there a way to convert a VFP form to PRG?
So I can create a form with the visual tools and then convert it to prg in
something like the following:
I am not sure if there is a practical reason for this, but I was thinking of
it.

Define CLASS MyForm AS form
  Height = 300
  Width = 600
  DoCreate = .T.
  Caption = "Test"
  Name = "Form"
  AlwaysOnTop=.t.
  AutoCenter=.t.
  ShowWindow=2
  Icon="My.ico"

Add OBJECT Grid AS Grid WITH ;
 Top = 10, ;
 Left = 5, ;
 Height = 100, ;
 Width = 100, ;
 Name = "Grid"

bla bla
bla bla
bla bla

EndDefine

Demetrios, Greece



Fri, 10 Dec 2004 13:19:44 GMT  
 Converting Form to PRG
Hi!

Open the form in the Class Browser. Then use "View Class Code" button to see
the converted code.
Copythat code into clipboard and paste into PRG. This is nto the end of the
story.
There is a limitation in VFP - you can include only one level of objects
into container or form by using "ADD OBJECT" statement in "DEFINE CLASS"
sturcture. This means that you can use ADD OBJECT to add a container, but
cannot useit to add object into that container just from the same DEFINE
CLASS structure. You have to re-format the code to something like folowing:

DEFINE CLASS MyForm AS Form
....
ADD OBJECT MyContainer AS ContClass WITH ...

ENDDEFINE

DEFINE CLASS ContClass AS Container

ADD OBJECT MyTextBox AS TextBox WITH ...

ENDDEFINE

--
WBR,
Vlad Grynchyshyn, Developer, MS MVP, MCP


Quote:
> Is there a way to convert a VFP form to PRG?
> So I can create a form with the visual tools and then convert it to prg in
> something like the following:
> I am not sure if there is a practical reason for this, but I was thinking
of
> it.

> Define CLASS MyForm AS form
>   Height = 300
>   Width = 600
>   DoCreate = .T.
>   Caption = "Test"
>   Name = "Form"
>   AlwaysOnTop=.t.
>   AutoCenter=.t.
>   ShowWindow=2
>   Icon="My.ico"

> Add OBJECT Grid AS Grid WITH ;
>  Top = 10, ;
>  Left = 5, ;
>  Height = 100, ;
>  Width = 100, ;
>  Name = "Grid"

> bla bla
> bla bla
> bla bla

> EndDefine

> Demetrios, Greece



Fri, 10 Dec 2004 16:09:54 GMT  
 Converting Form to PRG
Class Browser

Stasys


Quote:
> Is there a way to convert a VFP form to PRG?
> So I can create a form with the visual tools and then convert it to prg in
> something like the following:
> I am not sure if there is a practical reason for this, but I was thinking
of
> it.

> Define CLASS MyForm AS form
>   Height = 300
>   Width = 600
>   DoCreate = .T.
>   Caption = "Test"
>   Name = "Form"
>   AlwaysOnTop=.t.
>   AutoCenter=.t.
>   ShowWindow=2
>   Icon="My.ico"

> Add OBJECT Grid AS Grid WITH ;
>  Top = 10, ;
>  Left = 5, ;
>  Height = 100, ;
>  Width = 100, ;
>  Name = "Grid"

> bla bla
> bla bla
> bla bla

> EndDefine

> Demetrios, Greece



Fri, 10 Dec 2004 16:15:48 GMT  
 Converting Form to PRG
Thank you very much both.

Demetrios, Greece

Quote:
> Class Browser

> Stasys



> > Is there a way to convert a VFP form to PRG?
> > So I can create a form with the visual tools and then convert it to prg
in
> > something like the following:
> > I am not sure if there is a practical reason for this, but I was
thinking
> of
> > it.

> > Define CLASS MyForm AS form
> >   Height = 300
> >   Width = 600
> >   DoCreate = .T.
> >   Caption = "Test"
> >   Name = "Form"
> >   AlwaysOnTop=.t.
> >   AutoCenter=.t.
> >   ShowWindow=2
> >   Icon="My.ico"

> > Add OBJECT Grid AS Grid WITH ;
> >  Top = 10, ;
> >  Left = 5, ;
> >  Height = 100, ;
> >  Width = 100, ;
> >  Name = "Grid"

> > bla bla
> > bla bla
> > bla bla

> > EndDefine

> > Demetrios, Greece



Fri, 10 Dec 2004 23:47:37 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Can SCX convert to PRG

2. Code to convert a VUE to a PRG?

3. Possible to convert FPW26 report to .prg?

4. CONVERT scx TO PRG

5. converting from DBASE prg files

6. How to convert .exe files back to prg source .code files

7. CONVERT *.PRG

8. Converting Visual objects to PRG

9. CONVERT SCX to PRG

10. Forms: Converting BMP files to ICO files for use in icon properties of forms

11. Executing a PRG from a PRG

12. Big PRG or Small PRG?

 

 
Powered by phpBB® Forum Software