FUNCTION SayRupiah(par)
LOCAL nTot,nRp,cRp,cRupiah
ntot = 0
cRupiah=”"
lExit = .F.
nTot = par
cTotal= ALLTRIM(STR(nTot))
FOR i=1 TO LEN(cTotal)
nRp= (LEN(SUBSTR(cTotal,i)))
cRp= SUBSTR(cTotal,i,1)
DO CASE
CASE nRp > 0
GetDetailRupiah(nRp,cRp,@cRupiah)
CASE nRp < 0
nRp= nRp + 3
GetDetailRupiah(nRp,cRp,@cRupiah)
CASE nRp = 0
cRupiah = cRupiah
ENDCASE
NEXT
IF nTot - INT(nTot) > 0
cRupiah = cRupiah
ENDIF
RETURN cRupiah + “RUPIAH
Read the rest of this entry »
No Comments »
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
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 »
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 »
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 »
No Comments »