-
Re: Fill an empty table with stuff.
Gysbert Wassenaar Jan 7, 2013 1:58 PM (in response to tobbelito)This creates an empty table:
NewTable:
Load '' as Field1, '' as Field2
autogenerate 0;
In a loop you can do something like this:
for i=1 to 100
if 1=1 then
NewTable:
load 'a' as Field1, 123 as Field2
autogenerate 1;
end if
next i
-
Re: Fill an empty table with stuff.
tobbelito Jan 7, 2013 4:18 PM (in response to Gysbert Wassenaar )Hey Gysbert, thanx again!
Can't get it to work though. I'm trying sort of like this:
//Creating the empty table
NewTable:
Load '' as Field1, '' as Field2
autogenerate 0;
//My sub where i want to fill the table every time its called. Note that I want to fill one of the fields with pos, which is a string that is different each time it's called. Eventually I would like the second Field to have the count of the different pos coming in.
Sub crtTw(a,b)
let pos=a & ',' & b;
load pos as Field1, 123 as Field2
autogenerate 1;
end sub
//My loop where my sub get's called when a certain condition is met.
for i=0 to 100
let s=Peek('RECEIPT_NUMBER',i,'table1');
let t=Peek('RECEIPT_NUMBER',i+1,'table1');
if s=t then
let a=Peek('%Key_Trans_Item',i,'table1');
let b=Peek('%Key_Trans_Item',i+1,'table1');
CALL crtTw(a,b);
ENDIF
NEXT i
Not sure if this is comprehensible, but I'll throw it out anyway!
-
-
Re: Fill an empty table with stuff.
tobbelito Jan 12, 2013 10:15 AM (in response to tobbelito)bumpin this!