// General script for table viewing / download // // Example how to use it: // // Pushbutton (toolbar) "Download table" Process="viewtable.txt" // using tabname = "All items" // using fid1 = "Material" // using fid2 = "Price" // using fid3 = "Amount" // using fid4 = "Text" Parameter filename C:\temp\guixttemp.txt Parameter tabname Table Parameter fid1 1 Parameter fid2 2 Parameter fid3 3 Parameter fid4 4 OpenFile "&U[filename]" -Output Delimiter=";" // Variables Set V[absrow] 1 // Absolute row number Set V[relrow] 1 // Relative row number Screen * GetTableAttribute T[&U[tabname]] FirstVisibleRow=FVisRow LastVisibleRow=LVisRow LastRow=LastRow // First row on screen? if V[FVisRow=1] goto new_row endif // scroll to first line Enter "/ScrollToLine=1" Table="T[&U[tabname]]" label new_screen Screen * GetTableAttribute T[&U[tabname]] FirstVisibleRow=FVisRow LastVisibleRow=LVisRow LastRow=LastRow Set V[relrow] 1 label new_row // end of table? if V[absrow>&V[LastRow]] goto end_of_table endif // end of screen? if V[absrow>&V[LVisRow]] Enter "/ScrollToLine=&V[absrow]" Table="T[&U[tabname]]" goto new_screen endif Set V[C1] "&cell[&U[tabname],&U[fid1],&V[relrow]]" Set V[C2] "&cell[&U[tabname],&U[fid2],&V[relrow]]" Set V[C3] "&cell[&U[tabname],&U[fid3],&V[relrow]]" Set V[C4] "&cell[&U[tabname],&U[fid4],&V[relrow]]" AppendFile "&U[filename]" C1 C2 C3 C4 Set V[absrow] &V[absrow] + 1 Set V[relrow] &V[relrow] + 1 goto new_row label end_of_table CloseFile "&U[filename]" // Display file View "&U[filename]" // Back to line 1 Enter "/ScrollToLine=1" Table="T[&U[tabname]]" Leave