|
| what command to use ?(table) |
| Iniciado por guest, 07,jul. 2017 20:26 - 7 respuestas |
| |
| | | |
|
| |
| Publicado el 07,julio 2017 - 20:26 |
I would like to browse a table and extract the rows to another table.So far i have managed to do it with only the firs row.Can someone tell me what comand i can use to modify TableRecNum so i can make a loop that extracts all rows .
tableaddline(table2) table2.col1=table1.col1 table2.col2=table1.col2 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 07,julio 2017 - 20:42 |
Hi
Let me start by saying that it looks like you should start by studying the tutorial that comes with WinDev, in DETAILS.
Then, to answer your question: - if you search for LOOP in the help, you'll find a number of statements you can use (it's a choice which one): https://help.windev.com/en-US/search2.awp… - as for the table itself, it depends first on the type of table (you are not saying if it's linked to a file, filled by programming, etc), so I must first refer you to the basic help on table controls here: https://help.windev.com/en-US/… - but in any case, you should always use the line number in your statement (something like table2.Col1[LineNumber2]=table1.col1[lineNumber1])
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 07,julio 2017 - 20:51 |
table bye programing:
tableaddline(table2) table2.col1[1]=table1.col1[1]
i just tried it generates error |
| |
| |
| | | |
|
| | |
| |
| Publicado el 07,julio 2017 - 22:15 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,julio 2017 - 00:49 |
Hi
Indeed you should take a look at the tutorial it saves you time. But I will try to help you out a bit in your question
It is raw code but it will do what you want
if you make the table muti select you can use this. This is if you have 10 lines but onley want 5 to be placed in the second table.
FOR EACH SELECTED ROW OF TABLE_NoName1 TableAddLine(TABLE_NoName2,TABLE_NoName1.COL_NoName1,TABLE_NoName1.COL_NoName2) END
Otherwise:
FOR EACH ROW OF TABLE_NoName1 TableAddLine(TABLE_NoName2,TABLE_NoName1.COL_NoName1,TABLE_NoName1.COL_NoName2) END |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,julio 2017 - 03:37 |
i get this error message; File or query used by TABLE_1 as data source. Only visible elements will be available in programming. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,julio 2017 - 11:58 |
| I think you have your tablecontrol setup as a browsing table, so bound to a database file. Then the data is coming from that side (directly or using a query). You want to manually add data, then you have to make it a tablecontrol "handeld by programming". You can do that somewhere in the description of the control. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,julio 2017 - 22:00 |
Hi
so you said that your tables were filled by programming, but that clearly is true only for the table 2.
For a table linked to a file, only the lines that are VISIBLE at any given time are loaded in memory and therefore usable in code, so when you are doing your loop, you are using a line index that just doesn't exist at that moment.
Best regards |
| |
| |
| | | |
|
| | | | |
| | |
|