Hello Everyone,
I probably have the wrong syntax or i am missing something here, i compiled a prg file, added to a project and then build an exe file.
i even created a startup prg file to just call the MAIN prg file
The line in the startup prg file is as below
Do MAIN
READ EVENTS
MAIN.PRG have the code that includes the form, control, grid etc... the problem is, i was trying to get rid of the Main VFP screen, so i have a Config.fpw file with SCREEN = OFF in the same folder as the exe file resides, by the way i removed the config.fpw from the project and left it in the same folder where the exe is located cause anyway the exe run but it flash and right away dissapears, even if it is part of the project or not.
so i just remove the config from the project and left it in the folder, also i added into the code below(MAIN.PRG) as shown the showWindow=2 maybe the syntax is wrong ?
can you please, correct me , suggest me here ?
here is the code that runs the form
MAIN.PRG
Thanks in advance
I probably have the wrong syntax or i am missing something here, i compiled a prg file, added to a project and then build an exe file.
i even created a startup prg file to just call the MAIN prg file
The line in the startup prg file is as below
Do MAIN
READ EVENTS
MAIN.PRG have the code that includes the form, control, grid etc... the problem is, i was trying to get rid of the Main VFP screen, so i have a Config.fpw file with SCREEN = OFF in the same folder as the exe file resides, by the way i removed the config.fpw from the project and left it in the same folder where the exe is located cause anyway the exe run but it flash and right away dissapears, even if it is part of the project or not.
so i just remove the config from the project and left it in the folder, also i added into the code below(MAIN.PRG) as shown the showWindow=2 maybe the syntax is wrong ?
can you please, correct me , suggest me here ?
here is the code that runs the form
MAIN.PRG
Code:
SET EXCLUSIVE OFF
path_1="s:\pro50\apex04\apvend04" &&VFP 5.0 TABLE TYPE
path_2="S:\PRO50\APEX04\POmast04" &&VFP 5.0 TABLE TYPE
oForm = Createobject('myForm')
oForm.Show(1)
Set Safety Off
Define Class myForm As Form
Height = 250
Width = 300
AutoCenter = .T.
Caption = 'Search Vendor Names'
ShowTips = .T.
showWindow = 2
Add Object myGrid As Grid With ;
Height = 100, ;
Width = 200, ;
Top = 50, ;
Anchor=15, ;
DeleteMark = .F.,;
OleDragMode = 1, ;
GridLineColor = Rgb(192,192,192),;
FontName = 'Tahoma',;
FontSize = 8
Add Object label1 As Label With ;
top = 15,;
left = 8,;
caption = 'Enter Po# ',;
Backstyle = 0
Add Object Text1 As TextBox With ;
top = 15,;
left = 125,;
Height = 23,;
Width = 80,;
value = '',;
ToolTipText = 'Start typing to search matching records,'+;
' Double-click to clear search '
Procedure Load
Set Talk Off
Set Safety Off
Close Databases All
Set Exact On
SELECT po.purno, ap.company from (m.path_1) ap;
INNER Join (m.path_2) po ;
ON po.vendno=ap.vendno WHERE .F. Into Cursor crsSample Readwrite
Endproc
Procedure myGrid.Init
With This
.RecordSourceType = 6
.RecordSource = 'crsSample'
Endwith
Endproc
Procedure Text1.DblClick
This.Value = ''
This.InteractiveChange()
Endproc
Procedure Text1.InteractiveChange
Set Safety Off
Local lcSearch
lcSearch = Alltrim(This.Value)
SELECT po.purno, ap.company from (m.path_1) ap;
INNER Join (m.path_2) po ;
ON po.vendno=ap.vendno WHERE po.purno = PADL(m.lcSearch,10) Into Cursor crsSample2 Readwrite
Go Top
Select crsSample
Zap In crsSample
Append From Dbf('crsSample2')
Select company From crsSample2 Where purno == PADL(m.lcSearch,10) Into Cursor crsSample3 NOFILTER
Go Top
Thisform.myGrid.Refresh
Endproc
Procedure myGrid.OLEStartDrag
Lparameters oDataObject, nEffect
With This
.OLEDropMode = 0
With .Columns(.ActiveColumn)
Local lcValue
lcValue = Trim(Transform(Eval(.ControlSource)))
oDataObject.SetData(m.lcValue,1)
Endwith
Endwith
Endproc
Procedure Destroy
Clear Events
Endproc
Enddefine
Thanks in advance