SALT

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

Re: SALT

Postby Jinny on Wed Oct 10, 2018 6:57 pm

Hi Michael,

I've been following up the leads in your message and read loads of stuff about WC2 and watched a webinar. I'm now keen to play with it but still can't work out how to find the _namespace to get (and use) the functions.

Apologies if this is terribly obvious.

BW Jinny
Jinny
 
Posts: 9
Joined: Sun Jul 01, 2018 10:15 am

Re: SALT

Postby Michael|Dyalog on Thu Oct 11, 2018 8:06 am

Hi Jinny,
in order to "play" with it, you'll have to
      )load miserver  ⍝ recommandation: get the latest
Start'./MS3' ⍝ or any other site


The _-namespace is not a part of MiServer.dws (which explains your trouble finding it) - it is created dynamically when you start a site.

In response to the Start-Command, MiServer will spit out something like "MiServer for "./MS3" started on http://192.168.178.25:8080". Simply Ctrl+Click on the http:-address to open the site in your browser. Click on the "Samples"-tab to see a list of available controls and sample-code for them. There is a Search- Box into which you can type keywords describing a feature that you look for...and the list will be reduced to matching items as you type. Click on any sample to open the page. In the right part of the top-navigation of every sample page (even the list of controls!) you can always click the "View"-menu and select "APL Code" to inspect the code that created this page.

Alternatively, you can also do some interactive exploration in the APL-Session once MiServer has been started with a page (again: "Start" is neccessary to invoque all required classes...).
Basic example:
      p←#.HtmlElement.New _.i 'Hello World'
p.Render
<i>Hello World</i>

Playing with it:
      p←#.HtmlElement.New _.div   ⍝ create an empty <div>-tag
p.Render ⍝ verify!
<div></div>
p.Add _.b 'Hello World!' ⍝ Add to it
p.Add _.i 'I like Dyalog APL!' ⍝ I hope so ;-)
p.Render ⍝ verify!
<div><b>Hello World!</b><i>I like Dyalog APL!</i></div>
'#wow'p.Add _.p 'Jawdropping example' 'style=font-size:huge;' ⍝ define attributes while adding element!
p.Render ⍝ verify!
<div><b>Hello World!</b><i>I like Dyalog APL!</i><p id="wow" style="font-size:huge;">Jawdropping example</p></div>

I hope this provides some inspiration for your own experiments ;-)
Michael|Dyalog
 
Posts: 12
Joined: Thu Mar 02, 2017 4:29 pm

Previous

Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest