PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Display last row on Table Control
Display last row on Table Control
Iniciado por PRADEEP / Satin, 30,jul. 2019 10:50 - 3 respuestas
Miembro registrado
6 mensajes
Publicado el 30,julio 2019 - 10:50
I am populating the Table control with records using TableAddLine. The records are read from an external file.
Algorithm is as shown below:

BTN_getFileData
-
fileID = fOpen(fileName)
Buffer = fReadLine(fileID)
LOOP -> TableAddLine(TABLE_myTable, Buffer)

IF new Line ADDED THEN
TablePosition(TABLE_myTable, gnCurrentLineNumber, taVisible) //*** WORKS FINE

fTrackFile(fileName, checkNewRecordsInFile, ftModifyFile)


Procedure to update Table with new records: checkNewRecordsInFile
fileID = fOpen(fileName)
Buffer = fReadLine(fileID)
LOOP -> TableAddLine(TABLE_myTable, Buffer)

IF new Line ADDED THEN
TablePosition(TABLE_myTable, gnCurrentLineNumber, taVisible) //*** SHOWS FATAL ERROR


The table needs to display the latest record added, by scrolling to the bottom of the Table, each time a record is updated.
This works fine within the BTN_name, but throws a fatal error when I try to update within proceddure

--

--
Pradeep
Miembro registrado
4 mensajes
Publicado el 09,agosto 2019 - 19:48
gnCurrentLineNumber = TableAddLine(TABLE_myTable, Buffer)
TablePosition(TABLE_myTable, gnCurrentLineNumber)

--
mjcc
Miembro registrado
6 mensajes
Publicado el 15,agosto 2019 - 23:57
Thank You Manuel.

If you see the question, TablePosition was setting to the last records of the table.
The problem was when I try to set the TablePosition within an interrupt.

To make it work, I had to invoke a Global procedure from the file modification interrupt.

--
Pradeep
Miembro registrado
102 mensajes
Publicado el 06,septiembre 2019 - 12:00
Hi Pradeep,

not shure if I understood the question, but maybe this helps:

SendKey("^{END}" ,TABLE_myTable )


This will send a keystroke to the table TABLE_myTable, you can use this in your procedure.

HTH
Sebastian

--
WD23 with Oracle, WDM23 Apps for Android, iOS and Windows CE.
Python 3 with Oracle and MySQL. PHP with MySQL and JSON.