PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Display last row on Table Control
Display last row on Table Control
Iniciado por PRADEEP / Virtual So, jul., 30 2019 10:50 AM - 3 respostas
Membro registado
6 mensagems
Publicado em julho, 30 2019 - 10:50 AM
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
Membro registado
4 mensagems
Publicado em agosto, 09 2019 - 7:48 PM
gnCurrentLineNumber = TableAddLine(TABLE_myTable, Buffer)
TablePosition(TABLE_myTable, gnCurrentLineNumber)

--
mjcc
Membro registado
6 mensagems
Publicado em agosto, 15 2019 - 11:57 PM
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
Membro registado
102 mensagems
Popularité : +2 (2 votes)
Publicado em setembro, 06 2019 - 12:00 PM
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.