next up previous contents index
Next: From and To other Up: Communication with the Outer Previous: From a Program   Contents   Index

From other Packages: the ACCEPT command

The ACCEPT command in SIC often allows to directly read files from other packages provided one knows the file structure. Here is an example of how to read a bitmap from a PostScript file.

SIC\DEFINE INTEGER A[314,590] J
SIC\ACCEPT A /ARRAY IC348.TXT /FORMAT "(8(36Z2.2,/),26Z2.2)"
SIC\DEFINE IMAGE B TEST.GDF REAL /LIKE A
FOR I 1 TO B%DIM[2]
LET J B%DIM[2]+1-I
LET B[J] A[I]
NEXT
We assume you have extracted (using a standard text editor) the bitmap in a intermediate file (here IC348.TXT), and taken the sizes (here 314 by 590) from the PostScript description. The format specifier is generic, except for the exact padding required to read one bitmap row at a time.



Gildas manager 2014-07-01