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 ”
(more…)

Advertisements

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

VB6 – Non ODBC

Set db = New Connection
db.CursorLocation = adUseClient
db.Open “PROVIDER=MSDataShape;Data PROVIDER=” & _
“Microsoft.Jet.OLEDB.4.0;Data Source=” _
& App.Path & “\fpdata.mdb;Jet OLEDB:” & _
“Database Password=”;”

Visual Foxpro – ODBC

STORE SQLCONNECT(’exdata’, ‘admin’,”) TO gnConnHandle
IF gnConnHandle <= 0
= MESSAGEBOX(’Cannot make connection’, 16, ‘SQL Connect Error’)

*!* execute
SQLEXEC(gnConnHandle,”SELECT * FROM USER”,”USER”)
ENDIF