I'm trying to save 2 boxed tables of literal data in a component file, and
then read them back into J.

 

I've tried converting the tables to binary with 3!:1  and then creating a
component file with jcreate

and using jappend  to write to the jfile. This process seems to work OK.
When I try to read the data, I get the error shown below in my sample run.

 

 

My script file follows

 

NB.%scorecard2.ijs - saves & recalls globals FLAG and OWNED

NB. the globals are currently boxed shape 350 5 and each contains

NB. literal data

NB. Created 2017-02-07

NB. =========================================================

 

require 'jfiles'

 

NB.*savethem v Converts to binary and save in a J component file

savethem=: verb define

f=. CPATH,'flag-owned.jf'

jcreate f

(3!:1 FLAG) jappend f

(3!:1 OWNED) jappend f

jsize f

)

 

NB.*recallthem v Reads from component file

recallthem=: verb define

f=. CPATH,'flag-owned.jf'

FLAG0=: 3!:2 jread f;0

OWNED0=: 3!:2 jread f;1

)

 

NB. =========================================================

NB. Sample run follows:

Note''

 

JVERSION

Engine: j805/j64/windows

Release: commercial/2016-12-11T08:02:16

Library: 8.05.11

Qt IDE: 1.5.3s/5.6.2

Platform: Win 64

Installer: J805 install

InstallPath: c:/program files/j64-805

Contact: www.jsoftware.com

 

savethem''

0 2 263936 0

recallthem''

|domain error: recallthem

| FLAG0=: 3!:2 jread f;0

 

)

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to