View Raw SPL
/* show first few lines of translated binary file */
#define NUMWBLINES 50
/* writeb preview */
_prewb(ser, dtype)
{
local s, prevf;
if (eval(sprintf("length(%s)", ser)) > 0)
{
eval(sprintf("writeb('previewb.txt', %s, 1, extract(%s, 1, %d))", dtype, ser, NUMWBLINES));
/* read as binary and write as ASCII */
s = readb('previewb.txt', eval(dtype), NUMWBLINES);
if (length(s) > 0)
{
prevf = getmiscpath(1, 1) + "previewb.txt";
writea(prevf, s, 1);
viewfile(prevf, _previewstr);
delfile(prevf);
}
}
else
{
message("Preview Binary Data", sprintf(_nodatastr, ser), 8);
}
}