You probably already know all this, Jim!
Mea culpa, I only use JHS occasionally, for the purpose of transferring
scripts
between this Windows laptop and my iPad.
So to get a script from the laptop to the iPad:
0) I've got a small script ~user/myserver.ijs; here it is:
myserver =: 3 : 0
load '~addons/ide/jhs/jjserver.ijs'
serveaddress =: init_jjserver_ 'pswd'
)
echo myserver''
1) Fire up JHS - for me it runs (in) the browser window,
http://localhost:65001/jijx#,
Here's a snapshot of the session:
J Http Server
load'~user/myserver.ijs'
client access with: jjset '192.168.1.101
:65001 pswd'
I need to take note of that string!
2) On the iPad, my '~user/start.ijs' script also includes a verb
what I wrote myself, myserver:
(typing anew here, so beware errors!)
myserver =: 3 : 0
'' myserver y
:
jj 0
if. y -: '' do.
y =. '192.168.1.104:65001 pswd' NB. presumably varies for other
users?!
else.
y =. y,:65001 pswd' NB. if the default doesn't match the JHS
value observed above
end.
jjset y
if. #x do.
echo 'getting ',x
myget x
end.
)
3) Also, myget:
myget =: 3 : 0
jjget'~user/',y
)
4) Fire up the iPad's J701 app
5) To handshake with the laptop and immediately get a script from ~user:
'p632.ijs' myserver '192.168.1.101' NB. My default access string is
wrong!
6) To get another script from the laptop,
myget'p633.ijs'
or
jjget'~user/p633.ijs'
7) I haven't defined myput!
8) Writing this, it looks as if I should have defined a noun
in the iPad's start.ijs, perhaps
DEFAULTADDRESS='192.168.1.104'
and have start.ijs echo this value on start-up, so that you know
when it's necessary to enter a different address. But I haven't!
9) I get confused with the iPad version's handling of script
extensions, eg '.ijs' - I tend to add dots, eg p632.1.ijs which
seems to confuse "je" . I hadn't realised "load" was available, so
thankyou, Jim!
I've tailored my stuff for more convenient swapping of files
between my ~user folders. You might of course choose to define
mygetaddon to save a bit of typing!
Any use?
Mike
On 01/08/2018 13:27, 'Jim Russell' via Programming wrote:
Someday I hope to be smart enough to know that I am not smart enough to learn J.
Until then, would someone tell me how use jjget instead of jal to load whatever
I am missing when e.g.
load ‘trace’ or load ‘viewmat’
fails using J701 on my iPhone/iPad?
(I did get connected to my old Mac via jjget; I get confused with questions
like:
- How do I know what directory/library I need?
- Do I need j701 on the Mac?
- How do I get the jj server running on j701 on my Mac?
- Can I use jjget to restore jal, thus avoiding the confusion by loading
everything?)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm