Blinking during display

Blinking during display

Postby Arindam » 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
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby Arindam » Thu Apr 19, 2007 8:29 am

Hi everybody,

I think my last post was too lengthy for support. Ok. I need support for the following part only.

While I am entering a client’s Id, first it is display previous clients details in @Say area and then current client details. I have erased and removed all Say information from display area and also from oDbf. Even after that it is displaying previous client details.

How can I stop this double display ?

The process time slowly increase. After 10-15 process it is remarkable slow. Is it due to buffering problem? How can I clear the buffer?

How can I reduced the value of Dlg1:aControls ? ( as because the value is increasing in every process)

With regards,
Arindam
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby Enrico Maria Giordano » Thu Apr 19, 2007 9:05 am

I don't know if I understood correctly your problem but try to not create new SAY objects and use oSay:SetText() method instead to change SAY content.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Thu Apr 19, 2007 3:27 pm

Arimdam,

>I think my last post was too lengthy for support.

Yes, it is. We need a small self-contained example.

From a quick look at your code, it appears that you are doing lots of things the hard way. For instance, coding all your controls instead of using resources is the hard way.

If you add the UPDATE clause to all your SAYs. Then you don't need this code:

// Reload controls
For n = 1 to Len(oDlg1:aControls)
oDlg1:aControls[ n ]:Refresh(.T.)
Next

// Reload controls
aSize((oDlg1:aControls), 8

All you have to do is oDlg:refresh() and all the controls with the UPDATE clause will be refreshed. This is built-in to oDlg.

Then all you need to do to blank out all the SAYs is:

oDBF1:blank()
oDlg:refresh()

If you do this you can get rid of at least 50 lines of code.

But, I don't think you really need to blank out the SAYs--just reload the database object and redisplay:

oDBF1:skip() // or whatever...
oDlg:refresh()

This will probably solve your blinking problem.

And, may I suggest naming your oDBF objects something more meaningfull, like oCustomer. This makes it much easter to read and understand. With search & replace, this shouldn't take much time to do.

And when you post code, please use the CODE feature of the (forum) editor so it doesn't loose all the indentation.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Arindam » Thu Apr 19, 2007 8:03 pm

James,

Thanks for your guideline and also for quick look to my code. I am sure this will help me in future during coding

But, I am stuck in different part now. I am not updating any data (As this is only for information system. In very few occasion I am updating the information in Dbf) in any Dbf, simply erase the information from screens and entering next client Id. May be buffers are not clear and all problem due to this reasons.

My steps are:

1> I am entering a client Id, the client’s detail (i.e. name, address, …..other information) are picking up from two separate Dbf and displaying on screen. Near about 100 nos. information I pick up from Dbf and display on screen.

2> I am using command, @ nRow(), nCol() Say oSay Prompt oDbf:xFld of oDlg1 ……. Using same Say command for every display [ I think you have observed that in RegValCheck(….)]

3> After completing the job with particular client, I am erasing the Say information from display area [ I think you have observed that in CheckESC (….)]

4> Erasing and removed the information and entering next client Id.

My observation:

While I am entering a new client’s Id, first it is display previous clients details, in @Say area and then current client details. I am erasing and removing all @Say information from display area and also from oDbf 1, oDbf2,……. Even after that it is displaying previous client details.

As Enrico suggested to use oSay:SetText(), I can not understand where and how should I use this. Because I am using oSay to display all 100 information of a client.

With regards,
Arindam
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby James Bott » Thu Apr 19, 2007 9:35 pm

>But, I am stuck in different part now.

I am not sure what you are saying. Are you saying that the example you showed us is not what you are trying to debug?

>I am not updating any data (As this is only for information system. In very few occasion I am updating the information in Dbf) in any Dbf, simply erase the information from screens and entering next client Id. May be buffers are not clear and all problem due to this reasons.

Ah, perhaps you are confused. When I said "updating" I was referring to updating the SAYs with data from a database object NOT updating the database from the SAYs.

This code from your example IS displaying data from a database object:

@ 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

If you add the UPDATE clause to the SAY statement:

@ 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 UPDATE

And then blank the database object and refresh the dialog:

oDBF:blank()
oDlg:refresh()

The SAY should be empty.

You could probably test this in your existing code by just adding the UPDATE clause to one of the SAYS, then adding the code to blank the database object and refresh the dialog.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Fri Apr 20, 2007 6:05 am

Whoops. Above I said oDlg:refresh() but it should have been oDlg:update().

Below is a working example.

James


Code: Select all  Expand view
#include "fivewin.ch"

function main()
   local oDlg, oCust, oBtn

   use customer
   database oCust

   define dialog oDlg

   @ 1,2 say oCust:last UPDATE

   @ 3,2 button oBtn action ( oCust:blank(), oDlg:update() )

   activate dialog oDlg

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Arindam » Sun Apr 22, 2007 4:37 pm

James

Yes, I want to debug same example which I post earlier. As you have suggested, I have modify my code.

It is blank out the Says and remain as controls in oDlg1:aControls for next time use. As a result while I am entering next Client’s Id, then to displaying data from database object, I have to write in my code:

oSayODt:SetText(oDbf:OrderDt)
oSayONo:SetText(oDbf:OrderNo)
And so on total 100 Says.

To follow this I have to create total 100 oSay variables also, to identify the Says separately.

If I do not follow the above and use same Say statement, then the Says will be add as new controls in oDlg1:aControls. So every time 100 new controls add into the existing array. No, it is not expected.

My intention is to delete the Says control from the aControls, while I am going for next entry. If I am able to do so, I need not to create 100 oSay variables separately and easily can use same Say statement. This will not increase the length of the array also.

Is it possible? Is it practical? Is it right way?

Thank you once again for your last reply.

With regards,
Arindam
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Postby James Bott » Sun Apr 22, 2007 7:09 pm

Arindam,

>Is it possible?

Probably.

>Is it practical?

No.

>Is it right way?

No.

Did you try my example code? If you use the UPDATE clause with any control it adds the control to the list of controls that get automatically updated when you do oDlg:update(). You don't need to erase the data in the SAYs yourself, nor do you need to put new data in. The data is automaically replaced with new data when oDlg:update() is called. If the database pointer has been moved to a new record then all the SAYs will reload the data from the database object into the SAYs. Try my example code replacing the oCust:blank() witho oCust:skip() and you will see that new data gets displayed each time you press the button.

Forget everything you were trying to do. FW handles this all automatically.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Sun Apr 22, 2007 9:22 pm

Arindam,

Just try the code below with the FW\samples\customer.dbf file and you will see what I am talking about.

James

Code: Select all  Expand view
#include "fivewin.ch"

function main()
   local oDlg, oCust, oBtn

   use customer
   database oCust

   define dialog oDlg

   @ 1,2 say oCust:last UPDATE

   @ 3,2 button oBtn action ( oCust:skip(), oDlg:update() )

   activate dialog oDlg centered

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Tue Apr 24, 2007 5:43 pm

Arindam,

Just wondering if you have made any progress on this?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Arindam » Tue Apr 24, 2007 8:57 pm

James,

I have tested your sample code. It is working fine. May be there are some steping problem in my code. Once again I go through my code. if necessay I will get back to you for support.

Thank you for your kind efforts.

With regards,
Arindam
Arindam
 
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests