Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ideia for your CABuilder
Message
From
02/10/2003 18:39:02
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Ideia for your CABuilder
Miscellaneous
Thread ID:
00834580
Message ID:
00834580
Views:
54
Mark,
I made some changes in your CABuilder, and added something that I thing would help others.
I thing you could add some lines of code in your CABuilder in the AddClass Procedure,
it would help the Drag & Drop from the DE to the form.

Hope you like the idea.

[], s

Peter

Before the line where you create the Class
CREATE CLASS (lcCLass) OF (lcLib) AS CA_Base FROM (lcLib) NOWAIT
you could add this code (sample)
* If lWriteShema is .T. create a DBC and Table
IF THIS.lWriteSchema 
   THIS.Cr8_Create_Table(lcClass, THIS.cSchema)
ENDIF 
and add this procedure to the code

* Creates a DBC if necessary and the table with the same name that the CA class
* So its easyer to Drag & Drop from the Table the fields to a Form when CursorSchema > 255 Caract.
PROTECTED PROCEDURE Cr8_Create_Table
	LPARAMETERS lcClass, cSchema
	IF !FILE("DBC_CA.dbc")
		CREATE DATABASE DBC_CA		&& could be better (change the name of DBC !)
	ENDIF

	* Init from Schema
	npos = AT('2',cSchema) + 1
	cSchema  = SUBSTR(cSchema, npos)
	comprimento_cSchema = LEN(cSchema)

	* End from Schema
	npos2 = AT('ENDTEXT', cSchema) - 1
	cSchema  = SUBSTR(cSchema,1, npos2)

	cSchema = STRTRAN(cSchema,CHR(13),"")
	cSchema = STRTRAN(cSchema,CHR(10),"")

	* Creates the table in the DBC
	IF !DBUSED("DBC_CA")
		OPEN DATABASE DBC_CA
	ENDIF

	x = "CREATE TABLE " + (lcClass) + " (" + cSchema + ") "
	&x.
ENDPROC
Next
Reply
Map
View

Click here to load this message in the networking platform