Blinking during display
Posted: Tue Apr 17, 2007 8:48 pm
Hi!
In my following test code, no of say are more for display the information. My problem is that, while I am entering data during checking and displaying the information, the Say information’s are blinking. The blinking rates are increasing gradually.
#include "FiveWin.ch"
Static oGet, oSay, n, oFont, cStat
Static oDbf, oDbf1, oDbf2
//----------------------------------------------------------------------------//
Function Main()
Local oDlg1, BtnVal
Local oBtnFind, oBtnDele, oBtnNext, oBtnPrev, oBtnGo, oBtnAdd, oBtnEdit, oBtnSave
Local a1Buttons
Set Century On
Set Date Brit
Set Date format "dd/mm/yyyy"
// Replace value
cStat := "ADD"
// Open CustCat database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\CustCat.Dbf") Alias "RefCate" NEW SHARED
DATABASE oDbf2
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Cust_cat")
// Open Customer database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\Customer.Dbf") Alias "RefCust" NEW SHARED
DATABASE oDbf1
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Cust_no")
// Open Refill database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\Refill.Dbf") Alias "Refill" NEW SHARED
DATABASE oDbf
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Ref_ord")
// Clean the Customer dataBase buffer
oDbf:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:OrderNo := oDbf2:LstOrdNo + 1
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
oDbf:DaySerial := oDbf2:LstDaySrl + 1
//Field gets strt here
DEFINE FONT oFont NAME "COURIER" SIZE 12, 10
DEFINE DIALOG oDlg1 ICON oIco RESOURCE "Booking" of oBookWind TITLE "ADD INDENT" Color RGB(170, 200, 210), RGB(170, 200, 210)
SET FONT of oDlg1 to oFONT
REDEFINE BUTTON oBtnFind ID 1 OF oDlg1
REDEFINE BUTTON oBtnDele ID 2 OF oDlg1
REDEFINE BUTTON oBtnNext ID 3 OF oDlg1
REDEFINE BUTTON oBtnPrev ID 4 OF oDlg1
REDEFINE BUTTON oBtnGo ID 5 OF oDlg1
REDEFINE BUTTON oBtnAdd ID 6 OF oDlg1
REDEFINE BUTTON oBtnEdit ID 7 OF oDlg1 ;
ACTION ( CheckESC(oDlg1), oDlg1:Update() )
REDEFINE BUTTON oBtnBrow ID 8 OF oDlg1 ;
ACTION ( lBrowFun := .T., oDlg1:End() )
REDEFINE BUTTON oBtnSave ID 9 OF oDlg1 ;
ACTION ( SaveData( oRecStat, username, today, oDlg1, UserName ), oDlg1:Update() )
REDEFINE SAY oSay ID 12 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 13 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 14 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 15 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 16 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 17 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 18 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 19 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE GET oGet Var oDbf:CustNo ID 20 OF oDlg1 ;
Valid (If(!Empty(oDbf:CustNo), ;
RegValCheck( "ADD", userlevel, username, today, oDlg1 )), BtnPrsVal()) ;
Picture "@!" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
REDEFINE GET oGet Var oDbf:DlvyChrg ID 21 OF oDlg1 ;
When !Empty(oDbf:CustNo) ;
Valid If(nOption3 = 1, If(oDbf:DlvyMode == "H", ;
dChk(oDlg1, dName), .T.), .T.) ;
Picture "@Z 9999.99" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
REDEFINE GET oGet Var oDbf:DlvyReqst ID 22 OF oDlg1 ;
When !Empty(oDbf:CustNo) ;
Valid refcheck( "ADD" ) .And. ;
( If( SaveData( oRecStat, "ADD", today, oDlg1, UserName ), .T., (oDlg1:aControls[ 18 ]:Setfocus(), .T.) ), .T. ) ;
Picture "@!" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
a1Buttons = { oBtnFind, oBtnDele, oBtnNext, oBtnPrev, oBtnGo, ;
oBtnAdd, oBtnEdit, oBtnBrow, oBtnSave }
ACTIVATE DIALOG oDlg1 NOMODAL ;
Valid CloseFun( oRecStat )
// Disable appropriate buttons
For n = 1 to Len( a1Buttons ) - 3
a1Buttons[ n ]:Disable()
Next
// Following is to set focus
oDlg1:aControls[ 18 ]:SetFocus(.T.)
RELEASE FONT oFont
Return Nil
//----------------------------------------------------------------------------//
Static Function SaveData( oRecStat, helpIDX, today, oDlg1, Username )
Local saveAlias := Alias()
Local saveRecno, saveOrder, chkCashmo, cBar := .F.
Local cMRA := " "
Local dName := " "
// Confirm Message for continuation
If !MsgYesNo("Sure to save current record.", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
// First establish to locks configure control
Do While !(oDbf2:RecLock())
Enddo
oDbf2:Load()
dbSelectArea(saveAlias)
//Field gets strt here
DEFINE FONT oFont NAME "COURIER" SIZE 10, 10 BOLD
// All locks successfull, check dependencies first
If helpIDX == "ADD"
// Save the current database state
saveOrder := IndexOrd()
saveRecNo := RecNo()
chkCashmo := oDbf2:LstCshMemo+1
// Set the controlling index
dbSelectArea("Refill")
If chkCashmo <> 0
dbSeek(Dtos(oDbf:DlvyDt)+Str(ChkCashmo,8)+oDbf:ExtnCount)
If Found()
Tone(300,5)
MsgInfo("DUPLICATE CASHMEMO FOUND :" + CRLF + CRLF + ;
"Another Cashmemo found as un-delivered in Service." + CRLF + ;
"Please CANCEL or SERVICE the same.", "WARNING")
// Restore current database state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecNo)
oDbf8:UnLock()
CheckESC(oDlg1)
Return .T.
Endif
Endif
oDbf:OrderDt := oDbf2:LstOrdDt // Order Date
oDbf:OrderNo := oDbf2:LstOrdNo+1 // Order No
oDbf:DaySerial := oDbf2:LstDaySrl+1 // Day Serial No
oDbf2:LstOrdNo := oDbf:OrderNo
oDbf2:LstDaySrl := oDbf:DaySerial
If Empty(oDbf:ExtnCount)
oDbf:ExtnCount := "E0" // Extention No
Endif
// Restore current database state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecNo)
oDbf:Cashmemo := 0
// Update parameters
If oDbf:nOption1 == 1
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
RefBlaze->LstCshMemo := oDbf:Cashmemo
Endif
If oDbf:DlvyMode == "R" .And. oDbf:DlvyChrg > 0
oDbf:DlvyChrg := ((-1) * oDbf:DlvyChrg)
Endif
If oDbf:DlvyMode == "C"
oDbf:DlvyChrg := oDbf2:DelCharges
Endif
dbSelectArea("RefCust")
// Update customer array
oDbf1:TotRefill += oDbf:OrdCyl
oDbf1:LstOrdNo := oDbf:OrderNo
oDbf1:LstIndtDt := oDbf:OrderDt
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg + 1
// Routine check for auto home delivery
If oDbf:nOption1 <> 1
If oDbf2:AutoDlvy == .T. .And. ( oDbf:DlvyMode == "H" .Or. oDbf:DlvyMode == "C" )
If !(oDbf2:DlvyManCod)
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
oDbf2:LstCshMemo := oDbf:Cashmemo
Endif
// Replace refill database
oDbf:DlvyDt := today
// Replace customer database
oDbf1:LstDlvyDt := today
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg - 1
Endif
Else
If oDbf8:AutoDlvy == .T. .And. ( oDbf:DlvyMode == "H" .Or. oDbf:DlvyMode == "C" )
// Replace refill database
oDbf:DlvyDt := today
// Replace customer database
oDbf1:LstDlvyDt := today
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg - 1
Endif
Endif
// Update customer database
oDbf1:RecLock()
oDbf1:Save()
oDbf1:Commit()
oDbf1:UnLock()
If oDbf2:DataConvt == .T. .And. oDbf2:DlvyManCod == .T.
oDbf:CashmemoDt := today
Endif
// First establish to locks configure control
oDbf:Append()
oDbf:RecLock()
oDbf:Save()
oDbf:Commit()
oDbf:UnLock()
// Create new refill information
dbSelectArea(saveAlias)
Endif
// Refresh for new entry
oDbf:Blank()
oDbf1:Blank()
oDbf2:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:Order := oDbf2:LstOrdNo+1
oDbf:Cash := oDbf2:LstCshMemo+1
oDbf:DaySerial := oDbf2:LstDaySrl+1
// Display customer details
@ 05, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 80, 12 Font oFont
@ 06, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 07, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 08, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 09, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 10, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 60, 12 Font oFont
@ 12, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 150, 12 Font oFont
@ 14, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 16, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 17, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 09, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 10, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 11, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 15, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont
@ 16, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont
@ 17, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 23, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 27, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 28, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 30, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 31, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 32, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 34, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 35, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 36, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 37, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 6, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 24, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 25, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
// Erase booking history
@ 24, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 25, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 26, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 27, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 28, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 29, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 30, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 31, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 32, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 33, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 34, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 35, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 36, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 37, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
// Display booking info
@ 05, 118 Say oSay Prompt oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 06, 118 Say oSay Prompt oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 07, 118 Say oSay Prompt oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 08, 118 Say oSay Prompt oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
// Following is to set focus
oDlg1:aControls[ 18 ]:Refresh(.T.)
oDlg1:aControls[ 18 ]:Setfocus(.T.)
RELEASE FONT oFont
Return .T.
//----------------------------------------------------------------------------//
Static Function CloseFunc( oMenuItm, oMenu, oDlg1 )
oDbf:Close()
oDbf1:Close()
oDbf2:Close()
Return .T.
//-------------------------------------------------------------------//
Static Function RegValCheck( helpIDX, userlevel, username, today, oDlg1 )
Local saveAlias := Alias()
Local aMsg := ""
Local aDlvyList := {}
Local saveRecno, saveOrder, i, nDisp, lSay
Set Century On
Set Date Brit
Set Date format "dd/mm/yyyy"
If Empty(oDbf:CustNo)
Return .F.
Endif
dbSelectArea("RefCust")
dbSeek(oDbf:CustNo)
If Found()
// Reload Customer Info
oDbf1:Load()
Else
Tone(300,5)
MsgStop("INVALID CUSTOMER NO :" + CRLF + CRLF + ;
"Customer with this Customer No not available." + CRLF + ;
"Please enter correct No.", "WARNING")
dbSelectArea(saveAlias)
Return .F.
Endif
// Check customer category
If !chkkey("RefCate", oDbf1:CustCat, 1, ;
"INVALID CUSTOMER CATEGORY :" + CRLF + CRLF + ;
"Undefined customer category in Customer details.")
Return .F.
Else
dbSelectArea("RefCate")
dbSeek(oDbf1:CustCat)
// Reload category info
oDbf2:Load()
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
// Collect previous refill information
DispRef( aDlvyList )
// Check if customer has taken transfer TV/TTV
If !Empty(oDbf1:TvTtvNo)
Tone(300,5)
MsgStop("Customer has taken transfer from the Agency. " + ;
oDbf1:TvTtv + " No. " + ;
Transform(oDbf1:TvTtvNo, "@!") + ;
" on " + Transform(oDbf1:TvTtvDt, "@D") + "." + ;
" Transfered to " + TRIM(Transform(oDbf1:BlkOutDist, "@!")) + "." ,;
"WARNING")
Return .F.
Endif
// Display info
@ 05, 118 Say oSay PROMPT oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 06, 118 Say oSay PROMPT oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 07, 118 Say oSay PROMPT oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 08, 118 Say oSay PROMPT oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
// Display customer details
@ 05, 17 Say oSay PROMPT oDbf1:Degs of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 80, 12 Font oFont1
@ 06, 17 Say oSay PROMPT oDbf1:Name of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 07, 17 Say oSay PROMPT oDbf1:Add1 of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 08, 17 Say oSay PROMPT oDbf1:Add2 of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 09, 17 Say oSay PROMPT oDbf1:Land of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 10, 17 Say oSay PROMPT oDbf1:Pin of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 60, 12 Font oFont1
@ 12, 17 Say oSay PROMPT oDbf2:Desc of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 150, 12 Font oFont1
@ 14, 17 Say oSay PROMPT oDbf1:DgccNo of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 09, 80 Say oSay PROMPT oDbf1:Contact of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 10, 80 Say oSay PROMPT oDbf1:OTel of oDlg1 ;
Picture "@Z 9999999999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 11, 80 Say oSay PROMPT oDbf1:MTel of oDlg1 ;
Picture "@Z 9999999999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 23, 116 Say oSay PROMPT oDbf1:Member of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 27, 116 Say oSay PROMPT oDbf1:Area of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
If !Empty(oDbf1:AreaType)
If oDbf1:AreaType == "U"
@ 28, 116 Say oSay PROMPT "URBAN AREA" of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Elseif oDbf1:AreaType == "R"
@ 28, 116 Say oSay PROMPT "RURAL AREA" of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Elseif oDbf1:AreaType == "D"
@ 28, 116 Say oSay PROMPT "DEEPAM AREA." of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Endif
Endif
dbSelectArea(saveAlias)
// Save entry point state
saveRecno := RecNo()
saveOrder := IndexOrd()
// Display previous refill details
If Len(aDlvyList) > 0
// Position cursor
i := 24
nDisp := 1
// Display booking history
For ndisp := 1 To Len(aDlvyList)
@ i, 05 Say lSay PROMPT aDlvyList[ndisp][1] of oDlg1 ;
Picture "@!" Color RGB(255, 255, 255), RGB(170, 200, 210) SIZE 555, 12 Font oFont1
// Position cursor
++i
Next
i := 24
nDisp := 1
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoto(saveRecno)
If helpIDX == "ADD"
// Display the variable
If !(Empty(oDbf1:LtManDt))
@ 24, 116 Say oSay PROMPT Transform((oDbf1:LtManDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Else
@ 24, 116 Say oSay PROMPT Transform((oDbf1:ManDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Endif
@ 25, 116 Say oSay PROMPT Transform((oDbf1:ChgDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Endif
// Check if customer is temporarily suspended
If oDbf1:Suspended
Tone(300,5)
If !MsgYesNo("Customer is temporarily suspended. " + ;
"Reason " + Alltrim(oDbf1:Reason) + "." + CRLF + ;
"Would you like to continue ?", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
// Check if prev amount is due
If !Empty(oDbf1:AmtPending)
Tone(300,5)
If !MsgYesNo("Last Service amount is pending from this " + ;
"Customer Rs." + Transform(oDbf1:AmtPending, "@BZ 99999.99") + "." + CRLF + ;
"Would you like to continue ?", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
If !Empty(oDbf1:LstDDt) .And. ;
(oDbf:OrderDt - oDbf1:LstDlDt) < oDbf2:BkgInt
aMsg += "Too early for this Service." + CRLF
Endif
If !Empty(oDbf1:LtManDt) .And. ;
(oDbf:OrderDt - oDbf1:LtManDt) > oDbf2:MChkIntvl
aMsg += "Mandatory Inspection date is overdue." + CRLF
// Equate field memory variables
oDbf:ImtMessage := "Mandatory Check overdue"
Endif
If !Empty(aMsg)
Tone(300,5)
If !MsgYesNo(aMsg + CRLF + CRLF + ;
"Would you like to continue.", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
// Equate field memory variables
oDbf:Status := "N"
oDbf:DlvyReqst := oDbf1:DlvyReqst
If (oDbf1:TotOpenBkg >= oDbf2:MaxOpenBkg .And. oDbf2:Confirm == .F.)
Tone(300,5)
MsgStop("ATTENTION : " + CRLF + CRLF + ;
"Customer has one pending service. " + ;
"Category not permited for next " + ;
"Order.", "WARNING")
CheckESC(oDlg1)
Return .T.
Endif
If !Empty(oDbf1:LstDlvyDt) .And. ;
(oDbf:OrderDt - oDbf1:LstDlvyDt) < oDbf2:BkgIntervl
If userlevel <> "P"
// Early Booking
Tone(300,5)
MsgStop("ATTENTION : " + CRLF + CRLF + ;
"Service is not due. For this Service " + ;
"DSR's confirmation required. " ,;
"WARNING")
CheckESC(oDlg1)
Return .T.
Endif
Endif
oDbf:CustCat := oDbf1:CustCat
oDbf:CustArea := oDbf1:CustArea
oDbf:AreaType := oDbf1:AreaType
oDbf:CylType := oDbf2:CylType
oDbf:Gap := oDbf2:DlvIntervl
oDbf:BookTime := Time()
If !Empty(username)
Set Century Off
oDbf:GenOnBy := username+","+DTOC(today)
Set Century On
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoto(saveRecno)
Return .T.
//----------------------------------------------------------------------------//
Static Function CheckESC(oDlg1)
Local saveAlias := Alias()
Local saveOrder, oFont1
//Field gets strt here
DEFINE FONT oFont1 NAME "COURIER" SIZE 10, 10 BOLD
// Save entry point state
saveOrder := IndexOrd()
// Clear Dbf information
oDbf:Blank()
oDbf1:Blank()
oDbf2:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:OrderNo := oDbf2:LstOrdNo
oDbf:Cashmemo := oDbf2:LstCshMemo
oDbf:DaySerial := oDbf2:LstDaySrl
DEFINE FONT oFont1 NAME "COURIER" SIZE 10, 10 BOLD
// Display customer details
@ 05, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 80, 12 Font oFont1
@ 06, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 07, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 08, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 09, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 10, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 60, 12 Font oFont1
@ 12, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 150, 12 Font oFont1
@ 14, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 16, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 17, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 09, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 10, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 11, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 15, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont1
@ 16, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont1
@ 17, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 23, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 27, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 28, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 30, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 31, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 32, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 34, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 35, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 36, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 37, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 6, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 24, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 25, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
// Display booking history
@ 24, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 25, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 26, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 27, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 28, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 29, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 30, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 31, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 32, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 33, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 34, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 35, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 36, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 37, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
// Reload controls
For n = 1 to Len(oDlg1:aControls)
oDlg1:aControls[ n ]:Refresh(.T.)
Next
// Reload controls
aSize((oDlg1:aControls), 88)
// Display booking info
@ 05, 118 Say oSay PROMPT oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 06, 118 Say oSay PROMPT oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 07, 118 Say oSay PROMPT oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 08, 118 Say oSay PROMPT oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
// Following is to set focus
oDlg1:aControls[ 18 ]:Refresh(.T.)
oDlg1:aControls[ 18 ]:Setfocus(.T.)
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
RELEASE FONT oFont1
Return .T.
//----------------------------------------------------------------------------//
Static Function DispRef( aDlvyList )
Local saveAlias := Alias()
Local saveRecno, saveOrder, SrlNo
// Save entry point state
saveRecno := RecNo()
saveOrder := IndexOrd()
SrlNo := 0
dbSelectArea("Refill")
dbSetOrder (3)
// Setup database
dbSeek(oDbf:CustNo)
If Found()
// Display booking history
Do While !Eof()
If Refill->CustNo == oDbf:CustNo
Aadd(aDlvyList, {Dtoc(Refill->OrderDt) + " " + Str(Refill->OrdCyl) + " " + Str(Refill->Cashmemo)+ " " +;
(If(Refill->Status <> "C", Dtoc(Refill->DlvyDt), Space(10))) + " " + Refill->DlvyMan + " " +;
(If(Refill->Status == "C", Dtoc(Refill->DlvyDt), Space(10))) + " " + Str(Refill->OrderNo) + " " +;
Refill->Remarks})
Else
Aadd(aDlvyList, {" "})
Endif
++SrlNo
dbSkip()
If SrlNo = 14
Exit
Endif
SysRefresh()
Enddo
Endif
If Len ( aDlvyList ) < 14
SrlNo := Len ( aDlvyList )
Do While .T.
Aadd(aDlvyList, {" "})
++SrlNo
If SrlNo = 14
Exit
Endif
SysRefresh()
Enddo
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecno)
Return (aDlvyList)
//----------------------------------------------------------------------------//
Static Function BtnPrsVal()
If oBtnEdit:lMouseDown()
KEYBOARD CHR(K_ENTER)
Return .T.
Else
MsgStop("Field can not be blank. Required Valid Number for Process.","WARNING")
Endif
Return .F.
//----------------------------------------------------------------------------//
Static Function dChk(oDlg1, dName)
Return .T.
Can anyone give me solution to stop blinking in my testrun.prg.
With regards,
Arindam
In my following test code, no of say are more for display the information. My problem is that, while I am entering data during checking and displaying the information, the Say information’s are blinking. The blinking rates are increasing gradually.
#include "FiveWin.ch"
Static oGet, oSay, n, oFont, cStat
Static oDbf, oDbf1, oDbf2
//----------------------------------------------------------------------------//
Function Main()
Local oDlg1, BtnVal
Local oBtnFind, oBtnDele, oBtnNext, oBtnPrev, oBtnGo, oBtnAdd, oBtnEdit, oBtnSave
Local a1Buttons
Set Century On
Set Date Brit
Set Date format "dd/mm/yyyy"
// Replace value
cStat := "ADD"
// Open CustCat database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\CustCat.Dbf") Alias "RefCate" NEW SHARED
DATABASE oDbf2
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Cust_cat")
// Open Customer database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\Customer.Dbf") Alias "RefCust" NEW SHARED
DATABASE oDbf1
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Cust_no")
// Open Refill database and associate Indexes
USE (CurDrive() + ":\" + "Testpro\Data\Refill.Dbf") Alias "Refill" NEW SHARED
DATABASE oDbf
// Open associate index files.
SET INDEX TO (CurDrive() + ":\" + "Testpro\Data\Ref_ord")
// Clean the Customer dataBase buffer
oDbf:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:OrderNo := oDbf2:LstOrdNo + 1
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
oDbf:DaySerial := oDbf2:LstDaySrl + 1
//Field gets strt here
DEFINE FONT oFont NAME "COURIER" SIZE 12, 10
DEFINE DIALOG oDlg1 ICON oIco RESOURCE "Booking" of oBookWind TITLE "ADD INDENT" Color RGB(170, 200, 210), RGB(170, 200, 210)
SET FONT of oDlg1 to oFONT
REDEFINE BUTTON oBtnFind ID 1 OF oDlg1
REDEFINE BUTTON oBtnDele ID 2 OF oDlg1
REDEFINE BUTTON oBtnNext ID 3 OF oDlg1
REDEFINE BUTTON oBtnPrev ID 4 OF oDlg1
REDEFINE BUTTON oBtnGo ID 5 OF oDlg1
REDEFINE BUTTON oBtnAdd ID 6 OF oDlg1
REDEFINE BUTTON oBtnEdit ID 7 OF oDlg1 ;
ACTION ( CheckESC(oDlg1), oDlg1:Update() )
REDEFINE BUTTON oBtnBrow ID 8 OF oDlg1 ;
ACTION ( lBrowFun := .T., oDlg1:End() )
REDEFINE BUTTON oBtnSave ID 9 OF oDlg1 ;
ACTION ( SaveData( oRecStat, username, today, oDlg1, UserName ), oDlg1:Update() )
REDEFINE SAY oSay ID 12 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 13 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 14 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 15 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 16 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 17 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 18 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE SAY oSay ID 19 OF oDlg1 Color RGB(56, 61, 249), RGB(170, 200, 210) Font oFont1
REDEFINE GET oGet Var oDbf:CustNo ID 20 OF oDlg1 ;
Valid (If(!Empty(oDbf:CustNo), ;
RegValCheck( "ADD", userlevel, username, today, oDlg1 )), BtnPrsVal()) ;
Picture "@!" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
REDEFINE GET oGet Var oDbf:DlvyChrg ID 21 OF oDlg1 ;
When !Empty(oDbf:CustNo) ;
Valid If(nOption3 = 1, If(oDbf:DlvyMode == "H", ;
dChk(oDlg1, dName), .T.), .T.) ;
Picture "@Z 9999.99" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
REDEFINE GET oGet Var oDbf:DlvyReqst ID 22 OF oDlg1 ;
When !Empty(oDbf:CustNo) ;
Valid refcheck( "ADD" ) .And. ;
( If( SaveData( oRecStat, "ADD", today, oDlg1, UserName ), .T., (oDlg1:aControls[ 18 ]:Setfocus(), .T.) ), .T. ) ;
Picture "@!" Color RGB(0, 0, 0), RGB(255, 255, 255) Font oFont
a1Buttons = { oBtnFind, oBtnDele, oBtnNext, oBtnPrev, oBtnGo, ;
oBtnAdd, oBtnEdit, oBtnBrow, oBtnSave }
ACTIVATE DIALOG oDlg1 NOMODAL ;
Valid CloseFun( oRecStat )
// Disable appropriate buttons
For n = 1 to Len( a1Buttons ) - 3
a1Buttons[ n ]:Disable()
Next
// Following is to set focus
oDlg1:aControls[ 18 ]:SetFocus(.T.)
RELEASE FONT oFont
Return Nil
//----------------------------------------------------------------------------//
Static Function SaveData( oRecStat, helpIDX, today, oDlg1, Username )
Local saveAlias := Alias()
Local saveRecno, saveOrder, chkCashmo, cBar := .F.
Local cMRA := " "
Local dName := " "
// Confirm Message for continuation
If !MsgYesNo("Sure to save current record.", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
// First establish to locks configure control
Do While !(oDbf2:RecLock())
Enddo
oDbf2:Load()
dbSelectArea(saveAlias)
//Field gets strt here
DEFINE FONT oFont NAME "COURIER" SIZE 10, 10 BOLD
// All locks successfull, check dependencies first
If helpIDX == "ADD"
// Save the current database state
saveOrder := IndexOrd()
saveRecNo := RecNo()
chkCashmo := oDbf2:LstCshMemo+1
// Set the controlling index
dbSelectArea("Refill")
If chkCashmo <> 0
dbSeek(Dtos(oDbf:DlvyDt)+Str(ChkCashmo,8)+oDbf:ExtnCount)
If Found()
Tone(300,5)
MsgInfo("DUPLICATE CASHMEMO FOUND :" + CRLF + CRLF + ;
"Another Cashmemo found as un-delivered in Service." + CRLF + ;
"Please CANCEL or SERVICE the same.", "WARNING")
// Restore current database state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecNo)
oDbf8:UnLock()
CheckESC(oDlg1)
Return .T.
Endif
Endif
oDbf:OrderDt := oDbf2:LstOrdDt // Order Date
oDbf:OrderNo := oDbf2:LstOrdNo+1 // Order No
oDbf:DaySerial := oDbf2:LstDaySrl+1 // Day Serial No
oDbf2:LstOrdNo := oDbf:OrderNo
oDbf2:LstDaySrl := oDbf:DaySerial
If Empty(oDbf:ExtnCount)
oDbf:ExtnCount := "E0" // Extention No
Endif
// Restore current database state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecNo)
oDbf:Cashmemo := 0
// Update parameters
If oDbf:nOption1 == 1
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
RefBlaze->LstCshMemo := oDbf:Cashmemo
Endif
If oDbf:DlvyMode == "R" .And. oDbf:DlvyChrg > 0
oDbf:DlvyChrg := ((-1) * oDbf:DlvyChrg)
Endif
If oDbf:DlvyMode == "C"
oDbf:DlvyChrg := oDbf2:DelCharges
Endif
dbSelectArea("RefCust")
// Update customer array
oDbf1:TotRefill += oDbf:OrdCyl
oDbf1:LstOrdNo := oDbf:OrderNo
oDbf1:LstIndtDt := oDbf:OrderDt
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg + 1
// Routine check for auto home delivery
If oDbf:nOption1 <> 1
If oDbf2:AutoDlvy == .T. .And. ( oDbf:DlvyMode == "H" .Or. oDbf:DlvyMode == "C" )
If !(oDbf2:DlvyManCod)
oDbf:Cashmemo := oDbf2:LstCshMemo + 1
oDbf2:LstCshMemo := oDbf:Cashmemo
Endif
// Replace refill database
oDbf:DlvyDt := today
// Replace customer database
oDbf1:LstDlvyDt := today
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg - 1
Endif
Else
If oDbf8:AutoDlvy == .T. .And. ( oDbf:DlvyMode == "H" .Or. oDbf:DlvyMode == "C" )
// Replace refill database
oDbf:DlvyDt := today
// Replace customer database
oDbf1:LstDlvyDt := today
oDbf1:TotOpenBkg := oDbf1:TotOpenBkg - 1
Endif
Endif
// Update customer database
oDbf1:RecLock()
oDbf1:Save()
oDbf1:Commit()
oDbf1:UnLock()
If oDbf2:DataConvt == .T. .And. oDbf2:DlvyManCod == .T.
oDbf:CashmemoDt := today
Endif
// First establish to locks configure control
oDbf:Append()
oDbf:RecLock()
oDbf:Save()
oDbf:Commit()
oDbf:UnLock()
// Create new refill information
dbSelectArea(saveAlias)
Endif
// Refresh for new entry
oDbf:Blank()
oDbf1:Blank()
oDbf2:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:Order := oDbf2:LstOrdNo+1
oDbf:Cash := oDbf2:LstCshMemo+1
oDbf:DaySerial := oDbf2:LstDaySrl+1
// Display customer details
@ 05, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 80, 12 Font oFont
@ 06, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 07, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 08, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 09, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont
@ 10, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 60, 12 Font oFont
@ 12, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 150, 12 Font oFont
@ 14, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 16, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 17, 17 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 09, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 10, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 11, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 15, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont
@ 16, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont
@ 17, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 23, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 27, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 28, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 30, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 31, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 32, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont
@ 34, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 35, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 36, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 37, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 6, 80 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 24, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
@ 25, 116 Say oSay Prompt "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont
// Erase booking history
@ 24, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 25, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 26, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 27, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 28, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 29, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 30, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 31, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 32, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 33, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 34, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 35, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 36, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
@ 37, 05 Say oSay Prompt "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont
// Display booking info
@ 05, 118 Say oSay Prompt oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 06, 118 Say oSay Prompt oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 07, 118 Say oSay Prompt oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
@ 08, 118 Say oSay Prompt oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont
// Following is to set focus
oDlg1:aControls[ 18 ]:Refresh(.T.)
oDlg1:aControls[ 18 ]:Setfocus(.T.)
RELEASE FONT oFont
Return .T.
//----------------------------------------------------------------------------//
Static Function CloseFunc( oMenuItm, oMenu, oDlg1 )
oDbf:Close()
oDbf1:Close()
oDbf2:Close()
Return .T.
//-------------------------------------------------------------------//
Static Function RegValCheck( helpIDX, userlevel, username, today, oDlg1 )
Local saveAlias := Alias()
Local aMsg := ""
Local aDlvyList := {}
Local saveRecno, saveOrder, i, nDisp, lSay
Set Century On
Set Date Brit
Set Date format "dd/mm/yyyy"
If Empty(oDbf:CustNo)
Return .F.
Endif
dbSelectArea("RefCust")
dbSeek(oDbf:CustNo)
If Found()
// Reload Customer Info
oDbf1:Load()
Else
Tone(300,5)
MsgStop("INVALID CUSTOMER NO :" + CRLF + CRLF + ;
"Customer with this Customer No not available." + CRLF + ;
"Please enter correct No.", "WARNING")
dbSelectArea(saveAlias)
Return .F.
Endif
// Check customer category
If !chkkey("RefCate", oDbf1:CustCat, 1, ;
"INVALID CUSTOMER CATEGORY :" + CRLF + CRLF + ;
"Undefined customer category in Customer details.")
Return .F.
Else
dbSelectArea("RefCate")
dbSeek(oDbf1:CustCat)
// Reload category info
oDbf2:Load()
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
// Collect previous refill information
DispRef( aDlvyList )
// Check if customer has taken transfer TV/TTV
If !Empty(oDbf1:TvTtvNo)
Tone(300,5)
MsgStop("Customer has taken transfer from the Agency. " + ;
oDbf1:TvTtv + " No. " + ;
Transform(oDbf1:TvTtvNo, "@!") + ;
" on " + Transform(oDbf1:TvTtvDt, "@D") + "." + ;
" Transfered to " + TRIM(Transform(oDbf1:BlkOutDist, "@!")) + "." ,;
"WARNING")
Return .F.
Endif
// Display info
@ 05, 118 Say oSay PROMPT oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 06, 118 Say oSay PROMPT oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 07, 118 Say oSay PROMPT oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 08, 118 Say oSay PROMPT oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
// Display customer details
@ 05, 17 Say oSay PROMPT oDbf1:Degs of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 80, 12 Font oFont1
@ 06, 17 Say oSay PROMPT oDbf1:Name of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 07, 17 Say oSay PROMPT oDbf1:Add1 of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 08, 17 Say oSay PROMPT oDbf1:Add2 of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 09, 17 Say oSay PROMPT oDbf1:Land of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 10, 17 Say oSay PROMPT oDbf1:Pin of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 60, 12 Font oFont1
@ 12, 17 Say oSay PROMPT oDbf2:Desc of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 150, 12 Font oFont1
@ 14, 17 Say oSay PROMPT oDbf1:DgccNo of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 09, 80 Say oSay PROMPT oDbf1:Contact of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 10, 80 Say oSay PROMPT oDbf1:OTel of oDlg1 ;
Picture "@Z 9999999999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 11, 80 Say oSay PROMPT oDbf1:MTel of oDlg1 ;
Picture "@Z 9999999999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 23, 116 Say oSay PROMPT oDbf1:Member of oDlg1 ;
Picture "@!" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 27, 116 Say oSay PROMPT oDbf1:Area of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
If !Empty(oDbf1:AreaType)
If oDbf1:AreaType == "U"
@ 28, 116 Say oSay PROMPT "URBAN AREA" of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Elseif oDbf1:AreaType == "R"
@ 28, 116 Say oSay PROMPT "RURAL AREA" of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Elseif oDbf1:AreaType == "D"
@ 28, 116 Say oSay PROMPT "DEEPAM AREA." of oDlg1 ;
Picture "@!" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
Endif
Endif
dbSelectArea(saveAlias)
// Save entry point state
saveRecno := RecNo()
saveOrder := IndexOrd()
// Display previous refill details
If Len(aDlvyList) > 0
// Position cursor
i := 24
nDisp := 1
// Display booking history
For ndisp := 1 To Len(aDlvyList)
@ i, 05 Say lSay PROMPT aDlvyList[ndisp][1] of oDlg1 ;
Picture "@!" Color RGB(255, 255, 255), RGB(170, 200, 210) SIZE 555, 12 Font oFont1
// Position cursor
++i
Next
i := 24
nDisp := 1
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoto(saveRecno)
If helpIDX == "ADD"
// Display the variable
If !(Empty(oDbf1:LtManDt))
@ 24, 116 Say oSay PROMPT Transform((oDbf1:LtManDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Else
@ 24, 116 Say oSay PROMPT Transform((oDbf1:ManDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Endif
@ 25, 116 Say oSay PROMPT Transform((oDbf1:ChgDt), "@D") ;
of oDlg1 Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
Endif
// Check if customer is temporarily suspended
If oDbf1:Suspended
Tone(300,5)
If !MsgYesNo("Customer is temporarily suspended. " + ;
"Reason " + Alltrim(oDbf1:Reason) + "." + CRLF + ;
"Would you like to continue ?", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
// Check if prev amount is due
If !Empty(oDbf1:AmtPending)
Tone(300,5)
If !MsgYesNo("Last Service amount is pending from this " + ;
"Customer Rs." + Transform(oDbf1:AmtPending, "@BZ 99999.99") + "." + CRLF + ;
"Would you like to continue ?", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
If !Empty(oDbf1:LstDDt) .And. ;
(oDbf:OrderDt - oDbf1:LstDlDt) < oDbf2:BkgInt
aMsg += "Too early for this Service." + CRLF
Endif
If !Empty(oDbf1:LtManDt) .And. ;
(oDbf:OrderDt - oDbf1:LtManDt) > oDbf2:MChkIntvl
aMsg += "Mandatory Inspection date is overdue." + CRLF
// Equate field memory variables
oDbf:ImtMessage := "Mandatory Check overdue"
Endif
If !Empty(aMsg)
Tone(300,5)
If !MsgYesNo(aMsg + CRLF + CRLF + ;
"Would you like to continue.", "CONFIRM")
CheckESC(oDlg1)
Return .T.
Endif
Endif
// Equate field memory variables
oDbf:Status := "N"
oDbf:DlvyReqst := oDbf1:DlvyReqst
If (oDbf1:TotOpenBkg >= oDbf2:MaxOpenBkg .And. oDbf2:Confirm == .F.)
Tone(300,5)
MsgStop("ATTENTION : " + CRLF + CRLF + ;
"Customer has one pending service. " + ;
"Category not permited for next " + ;
"Order.", "WARNING")
CheckESC(oDlg1)
Return .T.
Endif
If !Empty(oDbf1:LstDlvyDt) .And. ;
(oDbf:OrderDt - oDbf1:LstDlvyDt) < oDbf2:BkgIntervl
If userlevel <> "P"
// Early Booking
Tone(300,5)
MsgStop("ATTENTION : " + CRLF + CRLF + ;
"Service is not due. For this Service " + ;
"DSR's confirmation required. " ,;
"WARNING")
CheckESC(oDlg1)
Return .T.
Endif
Endif
oDbf:CustCat := oDbf1:CustCat
oDbf:CustArea := oDbf1:CustArea
oDbf:AreaType := oDbf1:AreaType
oDbf:CylType := oDbf2:CylType
oDbf:Gap := oDbf2:DlvIntervl
oDbf:BookTime := Time()
If !Empty(username)
Set Century Off
oDbf:GenOnBy := username+","+DTOC(today)
Set Century On
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoto(saveRecno)
Return .T.
//----------------------------------------------------------------------------//
Static Function CheckESC(oDlg1)
Local saveAlias := Alias()
Local saveOrder, oFont1
//Field gets strt here
DEFINE FONT oFont1 NAME "COURIER" SIZE 10, 10 BOLD
// Save entry point state
saveOrder := IndexOrd()
// Clear Dbf information
oDbf:Blank()
oDbf1:Blank()
oDbf2:Blank()
oDbf:OrderDt := oDbf2:LstOrdDt
oDbf:OrderNo := oDbf2:LstOrdNo
oDbf:Cashmemo := oDbf2:LstCshMemo
oDbf:DaySerial := oDbf2:LstDaySrl
DEFINE FONT oFont1 NAME "COURIER" SIZE 10, 10 BOLD
// Display customer details
@ 05, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 80, 12 Font oFont1
@ 06, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 07, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 08, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 09, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 300, 12 Font oFont1
@ 10, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 60, 12 Font oFont1
@ 12, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 150, 12 Font oFont1
@ 14, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 16, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 17, 17 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 09, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 10, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 11, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@Z 9999999999" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 15, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont1
@ 16, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 95, 12 Font oFont1
@ 17, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 23, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 27, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 28, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 30, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 31, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 32, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 120, 12 Font oFont1
@ 34, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 35, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 36, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@!" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 37, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 6, 80 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 24, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
@ 25, 116 Say oSay PROMPT "" of oDlg1 ;
Picture "@D" Color RGB(170, 200, 210), RGB(170, 200, 210) SIZE 100, 12 Font oFont1
// Display booking history
@ 24, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 25, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 26, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 27, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 28, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 29, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 30, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 31, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 32, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 33, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 34, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 35, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 36, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
@ 37, 05 Say oSay PROMPT "" of oDlg1 ;
SIZE 555, 12 Color RGB(170, 200, 210), RGB(170, 200, 210) Font oFont1
// Reload controls
For n = 1 to Len(oDlg1:aControls)
oDlg1:aControls[ n ]:Refresh(.T.)
Next
// Reload controls
aSize((oDlg1:aControls), 88)
// Display booking info
@ 05, 118 Say oSay PROMPT oDbf:OrderDt of oDlg1 ;
Picture "@D" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 06, 118 Say oSay PROMPT oDbf:Order of oDlg1 ;
Picture "@Z 99999" Color RGB(237, 27, 27), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 07, 118 Say oSay PROMPT oDbf:Cash of oDlg1 ;
Picture "@Z 999.99" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
@ 08, 118 Say oSay PROMPT oDbf:DaySerial of oDlg1 ;
Picture "@Z 9999" Color RGB(0, 0, 0), RGB(170, 200, 210) SIZE 82, 12 Font oFont1
// Following is to set focus
oDlg1:aControls[ 18 ]:Refresh(.T.)
oDlg1:aControls[ 18 ]:Setfocus(.T.)
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
RELEASE FONT oFont1
Return .T.
//----------------------------------------------------------------------------//
Static Function DispRef( aDlvyList )
Local saveAlias := Alias()
Local saveRecno, saveOrder, SrlNo
// Save entry point state
saveRecno := RecNo()
saveOrder := IndexOrd()
SrlNo := 0
dbSelectArea("Refill")
dbSetOrder (3)
// Setup database
dbSeek(oDbf:CustNo)
If Found()
// Display booking history
Do While !Eof()
If Refill->CustNo == oDbf:CustNo
Aadd(aDlvyList, {Dtoc(Refill->OrderDt) + " " + Str(Refill->OrdCyl) + " " + Str(Refill->Cashmemo)+ " " +;
(If(Refill->Status <> "C", Dtoc(Refill->DlvyDt), Space(10))) + " " + Refill->DlvyMan + " " +;
(If(Refill->Status == "C", Dtoc(Refill->DlvyDt), Space(10))) + " " + Str(Refill->OrderNo) + " " +;
Refill->Remarks})
Else
Aadd(aDlvyList, {" "})
Endif
++SrlNo
dbSkip()
If SrlNo = 14
Exit
Endif
SysRefresh()
Enddo
Endif
If Len ( aDlvyList ) < 14
SrlNo := Len ( aDlvyList )
Do While .T.
Aadd(aDlvyList, {" "})
++SrlNo
If SrlNo = 14
Exit
Endif
SysRefresh()
Enddo
Endif
// Reset to entry point state
dbSelectArea(saveAlias)
dbSetOrder(saveOrder)
dbGoTo(saveRecno)
Return (aDlvyList)
//----------------------------------------------------------------------------//
Static Function BtnPrsVal()
If oBtnEdit:lMouseDown()
KEYBOARD CHR(K_ENTER)
Return .T.
Else
MsgStop("Field can not be blank. Required Valid Number for Process.","WARNING")
Endif
Return .F.
//----------------------------------------------------------------------------//
Static Function dChk(oDlg1, dName)
Return .T.
Can anyone give me solution to stop blinking in my testrun.prg.
With regards,
Arindam