Archive for August 30th, 2008

Within a timer, this function can be running periodically to reduce memory usage vfp application.
I have already try and work with well.

Function ReduceMemory()

Declare Integer SetProcessWorkingSetSize In kernel32 As SetProcessWorkingSetSize  ;
Integer hProcess , ;
Integer dwMinimumWorkingSetSize , ;
Integer dwMaximumWorkingSetSize
Declare Integer GetCurrentProcess In kernel32 As GetCurrentProcess
nProc = GetCurrentProcess()
bb = SetProcessWorkingSetSize(nProc,-1,-1)
*EOFunct ReduceMemory()

this function created by Bernard BoutReduce

Comments No Comments »

Private Sub cmdDownload01_Click()
If lStatusKonek Then
If chkDownload.Value = 0 Then
cmdDownload01.Enabled = False
MousePointer = vbHourglass
End If
Dim dwEnrollNumber As Long
Dim dwVerifyMode As Long
Dim dwInOutMode As Long
Dim timeStr As String
Dim i As Long
Dim lAddNew As Boolean

Dim v1 As String, v2 As Long, v3 As Long

lvX.Refresh
If chkDownload.Value = 1 Then
lvX.ListItems.Clear
End If

v1 = CStr(!no_id)
v2 = !baudrate
v3 = !no_port

Read the rest of this entry »

Comments No Comments »

This sample code for disable menu Data – Employee when employee form activated and enabled when form Employee deactivated.

Create menu Master :

Click “Edit” and create submenu “Employee” :

Click Create button and write command :

Read the rest of this entry »

Comments No Comments »

CLEAR ALL
#DEFINE STARTXL_LOC “Starting Excel……..”
#DEFINE ENDDATA_LOC “Transfer Finished..”
LOCAL xlsheet,XLApp,tmpsheet,n_hit,Title01,Title02

Title01 = “LIST OF EMPLOYEES”
Title02 = “COMPANY”

WAIT WINDOW STARTXL_LOC NOWAIT
tmpsheet=GetObject(”,’excel.sheet’)
XLApp=tmpsheet.application
XLApp.Visible=.t.
XLApp.WorkBooks.Add()
XLSheet=XLApp.ActiveSheet
XLSheet.Cells(1,01).Value = Title01
XLSheet.Cells(2,01).Value = Title02
XLSheet.Cells(4,01).Value = “ID”
XLSheet.Cells(4,02).Value = “NAME”
XLSheet.Cells(4,03).Value = “DIVISION”
XLSheet.Cells(4,04).Value = “DATE HIRED”

*!* Open table employee

Read the rest of this entry »

Comments No Comments »

This sample code for get data temperature in clipper :
FUNCTION GetTemperature()
LOCAL buff_size,com_ok,init_ok,c_input,l_send, t01,a01,b01,VAL_01
a01 := 0
b01 := 0
t01  := 0

buff_size := 4000 && 4000 byte buffer
com_ok := COM_OPEN(1,buff_size) && COM1: open
DO WHILE .T. .and. INKEY()<> K_ESC
IF .NOT. com_ok
? “It was not possible to open interface.”
ELSE
init_ok = COM_INIT(1, 9600, “N”, 8, 1)
IF .NOT. init_ok
alert(”It was not possible to initialize the interface”)
ELSE
** SENSOR 01
l_send = COM_SEND(1,”:01R;”)
INKEY(0.5)
c_input = COM_READ(1,COM_COUNT(1)) && Read in 10
IF LEN(ALLTRIM(c_input)) <= 0
t01 = 0
ENDIF
Read the rest of this entry »

Comments No Comments »

This sample VFP code for read data from temperature sensor :

*** Com1 setting = “9600,n,8,1″
thisform.MsCom.settings = “9600,n,8,1″
thisform.timer1.Interval = 1000

** SENSOR 01
VAL_01 = ASC(substr(thisform.MsCom.Input,5,5))
thisform.text1.Value = VAL_01

** SENSOR 02
thisform.MsCom.Output = ‘02R;’
VAL_02 = ASC(substr(thisform.MsCom.Input,5,5))
thisform.text2.Value = VAL_02

** SENSOR 03
thisform.MsCom.Output=’:03R;’
VAL_03 = ASC(substr(thisform.MsCom.Input,5,5))
thisform.text3.Value = VAL_03

Read the rest of this entry »

Comments No Comments »







Trek Pay - Terbukti sudah membayar 5 Dollar

Usaha modal kecil!

Modern Bedroom Furniture

Click Here to Advertise on My Blog

Add to Technorati Favorites

blogarama - the blog directory