PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Display last row on Table Control
Display last row on Table Control
Started by PRADEEP / Virtual So, Jul., 30 2019 10:50 AM - 3 replies
Registered member
6 messages
Posted on July, 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
Registered member
4 messages
Posted on August, 09 2019 - 7:48 PM
gnCurrentLineNumber = TableAddLine(TABLE_myTable, Buffer)
TablePosition(TABLE_myTable, gnCurrentLineNumber)

--
mjcc
Registered member
6 messages
Posted on August, 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
Registered member
102 messages
Popularité : +2 (2 votes)
Posted on September, 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.