(1) Create names for keyfiles eg:
(2) Erase any keyfiles with the same name (as requited)
(3) Create the keyfiles
(4) Check that keyfiles have been created with extension: .ijf
(5) Create some data in the base locale.
(6) Create some data in the zzz locale
(7) Save and retrieve data
| D | dltLastBox, dtDots |
| F | filesList, filesListn |
| N | nounsloc, nounsTable, nounsTableRetrieve |
| R | retrieveData, retrieveData1, retrieveDataTemp |
| S | saveData, saveData1, saveDataTemp |
dltLastBox(L)
L = boxed list
dltLastBox 'asdf';'sadf asdf';'exe'
┌────┬─────────┐
│asdf│sadf asdf│
└────┴─────────┘
dltLastBox <'asdf zxc'
┌────────┐
│asdf zxc│
└────────┘
dtDots(T)
T = text
dtDots 'asdf...'
dtDots 'as .. df'
as .. df
filesList(F)
F = path to folder
filesList(jpath '~addons/finance/fp')
filesListn(F)
F = path to folder
nounsloc(L)
L = locale name
nounsloc 'z'
nounsloc 'j'
nounsTable(L)
L = boxed list of noun names
nounsTable 'g' names ''
A =: i. 2 3
B =: 2 3 $ 'a'
nounsTable 'A';'B'
┌─┬─────┐
│A│0 1 2│
│ │3 4 5│
├─┼─────┤
│B│aaa │
│ │aaa │
└─┴─────┘
nounsTable ;: ,names_z_ 0
nounsTable ,&'_j_' each ;: ,names_j_ 0
nounsTable ;: names 0
nounsTableRetrieve(T)
T = boxed tabled created nounsTable
'A B C' =: 'AAA';123;i. 3 4
T =: nounsTable('A';'B';'C')
D =: 0{ T
erase('A B C')
nounsTableRetrieve(T)
([K])retrieveData(N)
[K] = optional keyfile name
default = KETFILE_DEFAULT
N = '' all nouns in locale are saved to the keyfile
noun name to be retrieved from keyfile
can have locale extension eg: N_zzz_
retrieveData('')
retrieveData('N1')
(KEYFILE_OTHER)retreiveData('')
([K])retrieveData1(N)
[K] = Optional keyfile name
DEFAULT = KEYFILE_DEFAULT - as defined in the base locale
N = noun name to be retrieved from keyfile
and written to the workspace
can have locale extension eg: N_zzz_
keydir KEYFILE_DEFAULT NB. shows the data saved in the keyfile
keydir KEYFILE_OTHER NB. shows the data saved in the keyfile
retrieveData1('D1')
retrieveData1('DZ_zzz_')
KEYFILE_OTHER retrieveData1('D1')
([K])retrieveDataTemp(N;[L]) y
[K] = optional path and keyfile
default = jpath '~user/temp/tempkeyfile.ijf'
retrieveDataTemp('')
([K])saveData(N;[L])
[K] = Optional file name
DEFAULT = KEYFILE_DEFAULT as defined in the base locale
N = noun names of data to be saved to keyfile
'' all nouns in locale are saved to the keyfile
'D1' is saved to the keyfile
'D1 D2' are saved to keyfile
[L] = optional locale name
default locale = base
locale extension is added to noun name
Create data in the base locale
DATA =: 'N1 N2 N3' =: (i. 3 4);'Data';i. 12 12
names 0 NB. show nouns in the base locale
Create data in the zzz locale
DATAZ_zzz_ =: 'NZ1_zzz_ NZ2_zzz_ NZ3_zzz_' =: (i. 5 4);'DataZ';i. 15 15
names_zzz_ 0 NB. show the nouns in the zzz locale
keydir KEYFILE_DEFAULT NB. shows the data saved in the keyfile
keydir KEYFILE_OTHER NB. shows the data saved in the keyfile
saveData('')
saveData('NZ1')
saveData('NZ1 NZ2';'zzz')
saveData('';'zzz')
KEYFILE_OTHER saveData('')
KEYFILE_OTHER saveData('N1 N2')
KEYFILE_OTHER saveData('N1 N2 DATAZ';'zzz')
([K]savedata1(N;[L])
[K] = Optional keyfile name
DEFAULT = KEYFILE_DEFAULT - as defined in the base locale
(N) = noun name of data to be saved to the keyfile
[L] = optional locale name
default locale = base
locale extension is added to noun name
D1 =: i. 3 4 NB. base locale
DZ_zzz_ =: 4 5 $'asd' NB. zzz locale
keydir KEYFILE_DEFAULT NB. shows the data saved in the keyfile
keydir KEYFILE_OTHER NB. shows the data saved in the keyfile
saveData1('D1')
saveData1('' ) NB. nothing written to keyfile
saveData1('XXX') NB. writes an empty item if no data.
saveData1('DZ';'zzz')
saveData1('DZ') NB. writes an empty item as DZ not in base locale
saveData1('DZ_zzz_') NB. writes an empty item as DZ not in base locale
KEYFILE_OTHER saveData1('D1')
KEYFILE_OTHER saveData1('DZ';'zzz')
KEYFILE_OTHER saveData1('DZ') NB. DZ not defined in base locale
([K])saveDataTemp(N;[L]) y
[K] = optional path and keyfile
default = jpath '~user/temp/tempkeyfile.ijf'
N = noun names of data to be saved to keyfile
'' all nouns in locale are saved to the keyfile
'D1' is saved to the keyfile
'D1 D2' are saved to keyfile
[L] = optional locale name
default locale = base
locale extension is added to noun name
saveDataTemp ''