Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/samples/solution/db/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/samples/solution/db/info.sct

+�VERSION =   3.00dataenvironmentdataenvironmentDataenvironment`Top = 339
Left = 10
Width = 507
Height = 158
DataSource = .NULL.
Name = "Dataenvironment"
12formformForm1�DataSession = 2
Top = 4
Left = 22
Height = 304
Width = 483
DoCreate = .T.
Caption = "Programatically Check Table Properties"
MinHeight = 256
MinWidth = 356
HelpContextID = 1231521
_memberdata = 
Name = "Form1"
�PROCEDURE getfieldinfo
LOCAL lo
SET COMPATIBLE OFF
lo = THIS.edtProperties
#DEFINE CR CHR(13)
#DEFINE TAB SPACE(3)
#DEFINE HEADER_LOC PADR("Field", 10) + TAB  + "Type" + TAB + "Length" + TAB + "Decimal" + TAB + "Allow NULL"
 
lo.Value = lo.Value + HEADER_LOC + CR
lo.Value = lo.Value + PADR("",LEN(HEADER_LOC), "-") + CR

nFields = AFIELDS(aFieldInfo, ALIAS())
FOR i = 1 TO nFields
	lo.Value = lo.Value + PADR(aFieldInfo[i,1], 10) + TAB + TAB +;
		aFieldInfo[i,2] + TAB + ;
		PADL(ALLTRIM(STR(aFieldInfo[i,3])), 5) + TAB +;
		PADL(ALLTRIM(STR(aFieldInfo[i,4])), 5) + TAB + TAB +;
		PADL(IIF(aFieldInfo[i,5], ".T.", ".F."), 5) + CR
ENDFOR

ENDPROC
PROCEDURE getindexinfo
LOCAL lo, i
lo = THIS.edtProperties
#DEFINE CR CHR(13)
#DEFINE TAB SPACE(3)
#DEFINE INDEXHEAD1_LOC "INDEX"
#DEFINE INDEXHEAD2_LOC PADR("Tag Name", 12) + TAB + TAB + "Expression"


FOR i = 1 TO 254
	IF !EMPTY(TAG(i))  && Checks for tags in the index
		IF i = 1
			lo.Value = lo.Value + CR + INDEXHEAD1_LOC + CR
			lo.Value = lo.Value + INDEXHEAD2_LOC + CR
			lo.Value = lo.Value + PADR("",LEN(INDEXHEAD2_LOC), "-") + CR
		ENDIF
		lo.Value = lo.Value + PADR(TAG(i),12) + TAB + TAB + KEY(i) + CR
	ELSE
		EXIT  && Exit the loop when no more tags are found
	ENDIF
ENDFOR
ENDPROC
PROCEDURE Init
IF  fontmetric(1, 'MS Sans Serif', 8, '') # 13 OR ;
	fontmetric(4, 'MS Sans Serif', 8, '') # 2 OR ;
	fontmetric(6, 'MS Sans Serif', 8, '') # 5 OR ;
	fontmetric(7, 'MS Sans Serif', 8, '') # 11
	this.setall('fontname', 'Tahoma')  
ELSE
	this.setall('fontname','MS Sans Serif')
ENDIF
this.setall('fontsize',8)

this.edtProperties.FontName = "Courier New"
this.edtProperties.FontSize = 10

ENDPROC
PROCEDURE Resize
THIS.resizable2.adjustcontrols
ENDPROC
PROCEDURE Activate
THIS.c_solutions1.saveHelp
ENDPROC
PROCEDURE Deactivate
IF TYPE("THIS.c_solutions1") = "O" THEN
	THIS.c_solutions1.restoreHelp
ENDIF
ENDPROC
t�� [[([%��+l�U����GA�T������jT�����C�Field�
�C�X�TypeC�X�LengthC�X�DecimalC�X�
Allow NULLC�
 ��uT�����C�CC�Field�
�C�X�TypeC�X�LengthC�X�DecimalC�X�
Allow NULL>�-�C�
 ��T��C��C��������(�������T�����CC����
�C�XC�XC���C�XCCCC���Z���C�XCCCC���Z���C�XC�XCCC����	�.T.��.F.6��C�
 ����ULOTHIS
EDTPROPERTIESVALUENFIELDS
AFIELDINFOIa����T�����������(�����Z�%�CC���
��J�%������(T�����C�
 �INDEXC�
 ��DT�����C�Tag Name��C�XC�X�
ExpressionC�
 ��OT�����C�CC�Tag Name��C�XC�X�
Expression>�-�C�
 ���6T�����CC����C�XC�XC�mC�
 ���V�!����ULOITHIS
EDTPROPERTIESVALUE:�%�C��
MS Sans Serif���$�
�!C��
MS Sans Serif���$��!C��
MS Sans Serif���$��!C��
MS Sans Serif���$�����!��C�fontname�Tahoma�������(��C�fontname�
MS Sans Serif�������C�fontsize�����T�����Courier New��T�����
��UTHISSETALL
EDTPROPERTIESFONTNAMEFONTSIZE
�����UTHIS
RESIZABLE2ADJUSTCONTROLS
�����UTHISC_SOLUTIONS1SAVEHELP9%%�C�THIS.c_solutions1b�O��2�
������UTHISC_SOLUTIONS1RESTOREHELPgetfieldinfo,��getindexinfo?��Init���Resize6��Activatel��
Deactivate���1qa�QBq�
A3�w!�A�Aa�AAA2d	��A��13�2�2Q�A1����,#��;%�>'9�A)[8coldalias
_memberdata
*getfieldinfo 
*getindexinfo 

commandbutton
commandbuttoncmdPrintForm1�Top = 274
Left = 311
Height = 23
Width = 72
FontBold = .F.
FontName = "MS Sans Serif"
FontSize = 8
Caption = "\<Print"
Enabled = .F.
TabIndex = 2
Name = "cmdPrint"
:PROCEDURE Click
LOCAL lcOldAlias,lcRepFile,lcStructDBF 
lcOldAlias = ALIAS()
lcStructDBF = SYS(2015)
COPY STRUCTURE EXTENDED TO (lcStructDBF)

SELECT 0
USE (lcStructDBF) ALIAS _temp EXCL
ALTER TABLE _temp ALTER COLUMN field_name c(20)
SET FIELDS TO field_name,field_type,field_len,field_dec,field_null


STORE "_frx" TO lcRepFile

CREATE REPORT (lcRepFile) FROM _temp 
*!*	REPORT FORM (lcRepFile) TO PRINTER PROMPT NOCONSOLE
REPORT FORM (lcRepFile) PREVIEW

IF FILE("_frx.frx") AND FILE("_frx.frt")
	DELETE FILE _frx.frx
	DELETE FILE _frx.frt
ENDIF
USE IN _temp
IF FILE(lcStructDBF+".dbf")
	DELETE FILE (lcStructDBF+".dbf")
	DELETE FILE (lcStructDBF+".fpt")
	DELETE FILE (lcStructDBF+".bak")
	DELETE FILE (lcStructDBF+".tbk")
ENDIF

IF !EMPTY(lcOldAlias)
	SELECT (lcOldAlias)
ENDIF

ENDPROC
�� ���|%7|F�U������T��C��T��C��]��
(�����F��Q������i1�_temp���C����G(������J��_frx�(��3����_temp�?�����(%�C�_frx.frx0�C�_frx.frt0	�����_frx.frx��_frx.frt��Q��%�C��.dbf0��m����.dbf�����.fpt�����.bak�����.tbk���%�C��
����
F�����U
LCOLDALIAS	LCREPFILELCSTRUCTDBF_TEMP
FIELD_NAME
FIELD_TYPE	FIELD_LEN	FIELD_DEC
FIELD_NULL_FRXFRXFRTClick,��1�������B��A�q1111A�A2/)�behindscenes..\solution.vcx
commandbutton
Behindscenes2Form1<Top = 274
Left = 11
TabIndex = 5
Name = "Behindscenes2"
cmdclose..\solution.vcx
commandbutton	Cmdclose3Form19Top = 274
Left = 400
TabIndex = 3
Name = "Cmdclose3"
0PROCEDURE Click
cmdClose::click
USE
ENDPROC
�� ��6v%Vme�U������Q�UCMDCLOSECLICKClick,��1�A1%)�c_solutions..\solution.vcxcustomC_solutions1Form1sTop = 271
Left = 41
Height = 18
Width = 25
fixedformborder = .F.
autosetdefault = .T.
Name = "C_solutions1"
editboxeditbox
edtPropertiesForm1�FontBold = .F.
FontName = "Courier New"
FontSize = 10
Height = 197
Left = 9
ReadOnly = .T.
TabIndex = 4
Top = 67
Width = 464
_memberdata = 
Name = "edtProperties"

commandbutton
commandbuttoncmdOpenForm1�Top = 274
Left = 232
Height = 23
Width = 72
FontBold = .F.
FontName = "MS Sans Serif"
FontSize = 8
Caption = "\<Open..."
TabIndex = 1
Name = "cmdOpen"
,PROCEDURE Click
USE ?
IF EMPTY(ALIAS())
	RETURN
ENDIF

LOCAL lo, lcDB, lcType
lo = THISFORM.edtProperties
#DEFINE CR CHR(13)

* Print cursor type and name 
nSourceType = CURSORGETPROP("sourcetype", ALIAS())
#DEFINE LVIEW_LOC "Local View: "
#DEFINE RVIEW_LOC "Remote View: "
#DEFINE TABLE_LOC "Table: "
DO CASE
	CASE nSourceType = 1
		lcType = LVIEW_LOC
	CASE nSourceType = 2
		lcType = RVIEW_LOC
	CASE nSourceType = 3
		lcType = TABLE_LOC
ENDCASE
lo.Value = lcType + CURSORGETPROP("sourcename", ALIAS()) + CR 


* Print Database Name
lcDB = CURSORGETPROP("database", ALIAS())
#DEFINE DB_LOC "Database: "
#DEFINE DBNONE_LOC "None"
lo.Value = lo.Value + DB_LOC + IIF(EMPTY(lcDB), DBNONE_LOC, lcDB) + CR + CR


#DEFINE NO_FLDS_LOC "Number of fields: "
lo.Value = lo.Value + NO_FLDS_LOC + ALLTRIM(STR(FCOUNT())) + CR 
#DEFINE NO_RECORDS_LOC "Number of records: "
lo.Value = lo.Value + NO_RECORDS_LOC + ALLTRIM(STR(RECCOUNT())) + CR + CR


THISFORM.GetFieldInfo
THISFORM.GetIndexInfo


THISFORM.cmdPrint.Enabled = .T.

ENDPROC
H�� //V%����UQ�?�%�CC����B�������T������T��C�
sourcetypeC��
H�f����������T���Local View: ���������T���
Remote View: ���������T���Table: ���)T����C�
sourcenameC�C�
 ��T��C�databaseC��ET������
Database: CC���
�None��6C�
 C�
 ��6T������Number of fields: CCC.Z�C�
 ��=T������Number of records: CCCNZ�C�
 C�
 ��
����
����T��	�
�a��ULOLCDBLCTYPETHISFORM
EDTPROPERTIESNSOURCETYPEVALUEGETFIELDINFOGETINDEXINFOCMDPRINTENABLEDClick,��1��AA�����AA��Sd���2!)/	resizable..\solution.vcxcustom
Resizable2Form1fTop = 278
Left = 90
Height = 19
Width = 27
repositionlist = Commandbutton Combobox Checkbox Listbox Form Grid Textbox Label Shape Editbox Olecontrol Pageframe Image Spinner Cmdclose Behindscenes2
resizelist = Commandbutton Combobox Checkbox Listbox Form Grid Textbox Label Shape Editbox Olecontrol Pageframe Image Spinner Cmdclose
Name = "Resizable2"
shapeshapeShape2Form1bTop = 14
Left = 10
Height = 44
Width = 463
BackStyle = 0
SpecialEffect = 0
Name = "Shape2"
labellabelLabel5Form1FontName = "MS Sans Serif"
FontSize = 8
WordWrap = .T.
Caption = "Open a table by clicking Open and then view its properties listed below.  Click Print to send a copy to your printer."
Height = 30
Left = 18
Top = 24
Width = 447
TabIndex = 0
Name = "Label5"
labellabelLabel6Form1�AutoSize = .T.
FontName = "MS Sans Serif"
FontSize = 8
Caption = " Instructions "
Height = 15
Left = 18
Top = 8
Width = 62
TabIndex = 0
Name = "Label6"
qArial, 0, 9, 5, 15, 12, 32, 3, 0
MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0
Courier New, 0, 10, 8, 16, 12, 9, 4, 0