Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 7 Jahren, 7 Monaten
Letzter Beitrag:
vor 7 Jahren, 7 Monaten
Beteiligte Autoren:
PlusPoint, Novica Njagojevic, Al, Ruben Sanchez Peña, Paulo Oliveira, Piet van Zanten

Hfilter is slow in Network

Startbeitrag von PlusPoint am 13.07.2010 12:45

Hi,


i have a problem, my Hfilter is very Slow in Network for below command :

SearchKey = HFilter(G_FormName, Line, 1, 1000000,"TXNTYPE='RCP' And TXNNO=" + Val(G_MyValues) + " And BRANCH='" + G_BRANCH + "'") //And TERMINALCODE = '" + G_TERMINAL + "'")
IF SearchKey "" THEN
HReadFirst(G_FormName, SearchKey)
WHILE NOT HOut


the records i m displaying in table view using (tableaddline), i can see literally see each line displaying on to grid. is not fast.

Is there any alternative for "hfilter " where i can use more than 1 condition. Hreadseekfirst, Hreadfirst.... these condition we can use only one condition.

Thanks & Regards,

Chandrahas Kurdekar



Antworten:

try using query instead of hfilter.

Check if TXNTYPE, TXNNO, BRANCH are defined as keys.

von Paulo Oliveira - am 13.07.2010 13:20
Hi,

Thanks
yes i Checked, TXNTYPE, TXNNO, BRANCH are defined as keys.

=====================================
SearchKey = HFilter(G_FormName, Line, 1, 1000000,"TXNTYPE='RCP' And TXNNO=" + Val(G_MyValues) + " And BRANCH='" + G_BRANCH + "'") //And TERMINALCODE = '" + G_TERMINAL + "'")
IF SearchKey "" THEN
HReadFirst(G_FormName, SearchKey)
WHILE NOT HOut
=============================

How i can use query instead hfilter for above example.
please show example for above hfliter.

Thanks & Regards,
Chandrahas


von PlusPoint - am 13.07.2010 14:09

Hi. I think HFilter is applied on the cliente workstation, not on server.

If you are using HF/CS then the optimal solution is use a Query. You only must define a parameter for each filter.


Rubén

von Ruben Sanchez Peña - am 13.07.2010 15:37
Hi Chandrahas,

You can create a query using the query wizard.
Right click queries in the project explorer and choose 'new query'.
You can browse a query after using hexecutequery just like a hyperfile with hReadxxxx commands.

Regards,
Piet

von Piet van Zanten - am 13.07.2010 20:46
Hello Chandrahas

Filling a memory table is always slow regardless of how you get the initial data. The profiler will give you the results of where your botttlenecks are.

One way to speed up your data collection might be to create a concatenated index for the three fields TXNTYPE + TXNNO + BRANCH

Your conditions must all be met to select a record so an alternative may be to set a single filter on the most unlikely value - the one that will give the least amount of matches and then test the resulting records on the other conditions as you will be starting from a smaller set of records. So if a match on the "Branch" value will return the smallest data set, filter on that key.


//in this case evaluate the Val(G_MyValues) outside the loop
//so the function only executes once
LMyvalues is int = Val(G_MyValues)
Hfilter(G_FormName, BRANCH,G_BRANCH)
HReadFirst(G_FormName, BRANCH)
WHILE NOT HOut
IF TXNTYPE = 'RCP' And TXNNO = LMyvalues
TableAdd()
end
HReadNext(G_FormName, BRANCH)
End



Regards
Al

von Al - am 13.07.2010 23:08
Hi,

Thank To everybody who had given me valuable reply.

I will try all suggestion. i will get back if any querys.

You all guys are great.

Thanks & regards,

Chandrahas

von PlusPoint - am 14.07.2010 11:12
Hi,

I tried With querys its is working fine.


sQuery = "QRY_PlusTransDisp"
{sQuery+".sBranch",indQueryParameter} = G_BRANCH
{sQuery+".sTxnno",indQueryParameter} = Val(G_MyValues)
{sQuery+".sTxnType",indQueryParameter} = "RCP"
HExecuteQuery(sQuery)

i was using these type of query to filter in Table view, i dont know why i didnt taught of or see it.
Thanks once again.


Now i have problem to Configure the port
i m using Code as below :
=============================
IF PortNum > 0 THEN
// String to write into the port
sStringToWrite is string = "String to write"
nLengthWritten is int // Length of the string that was written
SizeInputBuffer is int = 5000// Size of buffer for read operations
SizeOutputBuffer is int = 5000// Size of buffer for write operations
// Time-out between two characters for sRead/sWrite (in ms)
BufferTimeout is int = 100

// Open the port
IF NOT sOpen(PortNum, SizeInputBuffer, SizeOutputBuffer, BufferTimeout) THEN
//Error("Error opening COM" + PortNum)
ELSE
// Configure the port
IF NOT sParameter(PortNum, 19200, 0, 8, 0, True, True, True) THEN
==============================================
sParameter is not working.
can you tell if i m doing anything wrong, all combination of true, false, even i tried for Parity combination.

i have problem with serial Printer and Serial scanner. i want to change baudrate to 19200 instead of 9600. now what i doing is changing baudrate from DIP Switch to 9600.



Thanks & regards,

Chandrahas



von PlusPoint - am 14.07.2010 14:25
Hi Chandrahas
use Eltima virtual serial port and/or Eltima serial port monitor to see what happens with the state of the port. You have an 15 days trial period on the product.

Regards


von Novica Njagojevic - am 14.07.2010 16:59
Hi Novica Njagojevic

What means by "You have an 15 days trial period on the product" ?
sorry i didnt get that
Even i dont have idea of Eltima virtual serial port


Thanks & Regards

Chandrahas


von PlusPoint - am 15.07.2010 13:49
Hi
Eltimas software is commercial ,and has a 15 trial period,in case than you dont need to buy the software you have 15 days to finish your problem with serial port.


regards

von Novica Njagojevic - am 15.07.2010 14:22
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.