×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Class Browser with DataEnvironment
2

Class Browser with DataEnvironment

Class Browser with DataEnvironment

(OP)
Hi all,

here at my company, we use forms with CursorAdapters created using DataEnvironment.

When we try to convert the form in PRG file using Class Browser, all the information created via DataEnvironment is not contemplated in the PRG.

Is there a way to make this information inserted in this PRG file?

If it is not possible to be done using Class Browser, is there a way to transform the SCX file in DBF and, from this DBF, create a PRG file?

RE: Class Browser with DataEnvironment

What's your motivation?

To turn every form into a PRG and replace any SCX and VCX from projects or to turn forms and classes into text files for source code version control?

For source code control there's SCCText, see https://github.com/VFPX/SCCText,
there's also an improved version of that: https://github.com/VFPX/AlternateSCCText

And then there are other alternatives, like TwoFox: https://bitbucket.org/cwollenhaupt/foxpert.tools.t...

Chriss

RE: Class Browser with DataEnvironment

FWIW, the PRG created by the Class Browser isn't (and isn't meant to be) runnable code.

Tamar

RE: Class Browser with DataEnvironment

Tamar is right, and indeed the intention of ClassBrowserX is to create runnable PRGs.

Quote (https://github.com/VFPX/ClassBrowserX)

ClassBrowserX makes a working PRG

So if that's the goal that's a solution. If you're after text for SCC (source code control) then AlternateSCCText and TwoFox handle some difficulties the original scctext has, but then also using the class browser to get a text version of the form is not at all the way to solve it, which also wouldn't make ClassBrowserX a solution, even though it produces runnable code. The intention of scctext differs, the major goal is of course also completeness, a missing DE would of course be bad for source versioning, but the other focus is on enabling merge of changes from two different branches of development.

Also the two scctext variants will be used in VFP options in the projects tab in the PRG you specify for "Text generation". And you couldn't specify an APP there, neither browser.app nor BrowserX.app.

That's why I ask, what's the motivation.

Chriss

RE: Class Browser with DataEnvironment

(OP)
Thx for all interactions...

The main problem still is that all DataEnvironment data is not being created.





I need that all this informations are contemplated when I create my PRG file...

I don't need an executable PRG....it is just to code source control on GitHub.

RE: Class Browser with DataEnvironment

Quote (umnarcon)

it is just to code source control on GitHub.

Well, besides the new recommendation by atlopes you were already pointed towards either scctext or better AlternateSCCText and TwoFox.

What have you tried? You show one unsuccessful result, but what did you use for that?

Chriss

RE: Class Browser with DataEnvironment

Seems you find fx2bin.prg best to use.

I just tried alternateSCCText and on a solution form: datalook.scx and it includes the content of the Dataenvironment in the form of records:

CODE -->

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _R9G0NR4GU
[CLASS] cursor
[BASECLASS] cursor
[OBJNAME] Cursor1
[PARENT] Dataenvironment
[START PROPERTIES]
Alias = "orders"
CursorSource = "orders"
Database = ..\..\data\testdata.dbc
Height = 301
Left = 53
Name = "Cursor1"
Top = 141
Width = 99
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _R9G0NR4H5
[CLASS] cursor
[BASECLASS] cursor
[OBJNAME] Cursor2
[PARENT] Dataenvironment
[START PROPERTIES]
Alias = "employee"
CursorSource = "employee"
Database = ..\..\data\testdata.dbc
Height = 90
Left = 150
Name = "Cursor2"
Top = 20
Width = 99
[END PROPERTIES] 

Anyway, I see the prg as it is provided has this status about one-way vs two-way support:

CODE -->

* Text file support for each file type
*	0 indicates no text file support
*	1 indicates one-way support (to text)
*	2 indicates two-way support (for merging)
#DEFINE SCC_DBC_SUPPORT		0
#DEFINE SCC_DBF_SUPPORT		0
#DEFINE SCC_FORM_SUPPORT	1
#DEFINE SCC_LABEL_SUPPORT	1
#DEFINE SCC_MENU_SUPPORT	1
#DEFINE SCC_REPORT_SUPPORT	1
#DEFINE SCC_VCX_SUPPORT		1 

Which indicates that alternatescctext can be used to have a text version of an SCX for source code control, but you need to check in the binary file, too, as you can't generate an SCX from the text file generated. There might be a better version of this available that does the two-way support.

Chriss

RE: Class Browser with DataEnvironment

To not forget this: TwoFox does the two-way support, generating a text file 8with XML that can be checked in to Git or any SCC software and convert the text files back to binary format.

Chriss

RE: Class Browser with DataEnvironment

Here is how to create a Dataenvironment in a PRG (Sorry for the French bits)


oForm = Createobject("form")
oForm.caption ="Un formulaire et son enviromement"
oForm.AddObject("oenv","de")
oForm.AddObject("command1","oButton")
oForm.command1.Visible = .T.
oForm.Show(1)
Define Class CUSTOMER As Cursor
  Alias = "CUSTOMER"
  CursorSource = "CUSTOMER"
  Database = Home()+"SAMPLES\DATA\TESTDATA.DBC"
Enddefine

Define Class ORDERS As Cursor
  Alias = "ORDERS"
  CursorSource = "ORDERS"
  Database = Home()+"SAMPLES\DATA\TESTDATA.DBC"
Enddefine

Define Class ORDITEMS As Cursor
  Alias = "ORDITEMS"
  CursorSource = "ORDITEMS"
  Database = Home()+"SAMPLES\DATA\TESTDATA.DBC"
Enddefine

Define Class Cust_To_Orders As Relation
  ChildAlias = "ORDERS"
  ParentAlias = "CUSTOMER"
  ChildOrder = "CUST_ID"
  RelationalExpr = "CUST_ID"
Enddefine

Define Class Orders_To_OrdItems As Relation
  ChildAlias = "ORDITEMS"
  ParentAlias = "ORDERS"
  ChildOrder = "ORDER_ID"
  RelationalExpr = "ORDER_ID"
Enddefine

Define Class DE As DataEnvironment
  Add Object oCUSTOMER             As CUSTOMER
  Add Object oORDERS               As ORDERS
  Add Object oORDITEMS             As ORDITEMS
  Add Object oCust_To_Orders       As Cust_To_Orders
  Add Object oOrders_To_OrdItems   As Orders_To_OrdItems

  Procedure Init
    This.OpenTables()
  Endproc

Enddefine
Define Class oButton As CommandButton
    Caption ="Ouvrir la table customer"
    height = 23
    width = 150
    top = 20
    left = 20
  Procedure Click
    Select CUSTOMER
    Browse
  Endproc
Enddefine
 



If you want to get the best response to a question, please check out FAQ184-2483: How to get the best response from the forum first.

RE: Class Browser with DataEnvironment

Mike Gagnon,

thanks for that idea. It applies to the case where you want this prg to work, but for SCC all that matters is getting the information and being able to reproduce the binary scx form in the end.

So the DE data can also be stored in XML of records, as TwoFox handes this, or in a record format AlternateSCCText uses. What's not working with the AlternateSCCText version I got is the inverse step. And I think there should be a version that does that.

I havn't tried how foxbin2prg works, but it does seem to do the job, too.

Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close