If I understand properly then you can do something like this:
float $timeArray[] = {};
float $valueArray[] = {};
int $nextIndex = size($timeArray);
float $currentTime = `currentTime -q`;
string $myObject = "pCube1";
$timeArray[$nextIndex] = $currentTime;
$valueArray[$nextIndex] = `getAttr -t $currentTime ($myObject + ".tx")`;
A
Technical Director - Framestore
Currently working on: Your Highness
IMDB