
gpsrc=
!for i=1 to $saverank
 error_data=$i
 v$i=!trim $(v$i)
 !if $(v$i)=$empty
  error=empty_data
  !exit
 !endif
 n=!itemcnt $(v$i)
 !if $n>1
  error=vec_for_poly
  !exit
 !endif
 wims_rawmath_variables=x,X
 v$i=!rawmath $(v$i)
 v$i=!mathsubst x=X in $(v$i)
 vs=!varlist $(v$i)
 !for v in $vs
  !if $v!=X
   error=bad_variable
   !exit
  !endif
 !next v
 gpsrc=!append line print(Vec($(v$i))) to $gpsrc
!next i

pariout=!exec pari $gpsrc

base=
!for i=1 to $saverank
 error_data=$i
 l=!line $i of $pariout
 l=!trim $l
 !if $l=$empty
  error=bad_poly
  !exit
 !endif
 n=!itemcnt $l
 !if $n>$dim
  error=degree_too_big
  !exit
 !endif
 l=!item -$dim to -1 of 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,$l
 base=!append line $l to $base
!next i
error_data=

