diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/texpand/movtbrow.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/texpand/movtbrow.x')
-rw-r--r-- | pkg/utilities/nttools/texpand/movtbrow.x | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/texpand/movtbrow.x b/pkg/utilities/nttools/texpand/movtbrow.x new file mode 100644 index 00000000..9f9bb3f1 --- /dev/null +++ b/pkg/utilities/nttools/texpand/movtbrow.x @@ -0,0 +1,43 @@ +include <tbset.h> + +# MOVTBROW -- Move columns from one table to another where not null +# +# B.Simon 25-Apr-88 Original +# B.Simon 15-Jan-99 now calls mov_elem + +procedure movtbrow (rtp, rrow, wtp, wrow) + +pointer rtp # i: Table descriptor of table read from +int rrow # i: Row number of table read from +pointer wtp # i: Table descriptor of table written to +int wrow # i: Row number of table written to +#-- +int ncol, icol +pointer sp, rcp, wcp, colname + +pointer tbpsta(), tbcnum() + +begin + call smark (sp) + call salloc (colname, SZ_COLNAME, TY_CHAR) + + ncol = tbpsta (rtp, TBL_NCOLS) + do icol = 1, ncol { + + rcp = tbcnum (rtp, icol) + call tbcigt (rcp, TBL_COL_NAME, Memc[colname], SZ_COLNAME) + call tbcfnd (wtp, Memc[colname], wcp, 1) + +# Column names beginning with an underscore are for internal +# use by the program and do not contain actual data + + if (Memc[colname] != '_' && wcp != NULL) { + + # Copy the row and column in its native type + + call mov_elem (rtp, rcp, rrow, wtp, wcp, wrow) + } + } + + call sfree (sp) +end |