Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
//1st subroutine
Sub createanddrop (vTableName)
Store $(vTableName) into [$(vTableName).qvd];
Drop Table [$(vTableName)];
End Sub
// 2nd subroutine
sub pop
FOR i=1 to NoOfTables();
LET vTable=TableName($(i) -1);
CALL createanddrop($(vTable));
NEXT i
END SUB
//Main call to subroutine
Call pop;
This is my code....I want to use call within a subroutine, so that I can pass parameter to another subroutine.
Thanks
Solved. Here it is:
//1st subroutine
Sub createanddrop (vTableName)
Store $(vTableName) into [$(vTableName).qvd];
Drop Table $(vTableName);
End Sub
// 2nd subroutine
SUB pop
FOR i=1 to NoOfTables() -1;
LET vTable=TableName($(i) -1);
CALL createanddrop(vTable);
NEXT i
END SUB
// CALL
CALL pop;
It should work.
I think your code its fine. It should work.
Plz go through my code....
its not working.......I am not able to bring my table name to 1st subroutine
Hi
Try
CALL createanddrop(vTable);
or
CALL createanddrop('$(vTable)');
HTH
Jonathan
I would also modify line 2
Store [$(vTableName)] into [$(vTableName).qvd] (qvd);
Solved. Here it is:
//1st subroutine
Sub createanddrop (vTableName)
Store $(vTableName) into [$(vTableName).qvd];
Drop Table $(vTableName);
End Sub
// 2nd subroutine
SUB pop
FOR i=1 to NoOfTables() -1;
LET vTable=TableName($(i) -1);
CALL createanddrop(vTable);
NEXT i
END SUB
// CALL
CALL pop;
Use
FOR i=1 to NoOfTables() -1;
instead of
FOR i=1 to NoOfTables() ;
AND
CALL createanddrop(vTable);
instead of
CALL createanddrop($(vTable));
Luis.
Not sure it will work
If you delete a table, what will be the next time the result of TableName (counter) when you increment your counter. I think you will skip some tables.
Certainly, you have to get your table to export and delete through a simple TableName(0). And do a loop as you did (certainly by storing NoOfTable into a variable)
Fabrice