]user commands and MiServer programming

MiServer is Dyalog's APL-based web development framework

]user commands and MiServer programming

Postby woody on Sat Jun 04, 2016 7:12 pm

Greetings.

Is it possible for MiServer .dyalog MiPages to reference User Commands?

a←⍎']?' does not work.

Can user commands be called within APL program?

Thanks!

//W
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 144
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: ]user commands and MiServer programming

Postby DanB|Dyalog on Sat Jun 04, 2016 7:51 pm

Using ⍎ on strings that contain invalid APL statements like anything starting with ] or ), for example, will yield an APL error.

Most system commands (starting with a ')') have system function equivalent, e.g. )WSID has a ⎕WSID similar function.

User commands don't have system function equivalents.
When you call a user command the system takes the string to the right of the ']' and passes it on to ⎕SE.UCMD as right argument.
You can use that program too, i.e. to call
      ]?

you can do
      ⎕SE.UCMD '?'

and catch the result if you wish.
DanB|Dyalog
 

Re: ]user commands and MiServer programming

Postby woody on Sat Jun 04, 2016 10:24 pm

Excellent!

works like a charm.

Code: Select all
  Load 'APLROOT'
Development environment loaded
MiSite "D:\APL\MiServerV24-APLscriptV2\APLROOT\" loaded

       ⎕SE.UCMD 'Load D:\APL\MiServerV24-APLscriptV2\APLROOT\*'

 #.APLscript  #.Start  #.WIKIPortal  #.editscript  #.helloworld  #.index  #.indexOLD1  #.EditPage  #.httprequest  #.sessioninfo  #.Status  #.CLEARNS  #.CLEARNS  #.CLEARNS 
... snip...


//W
Woodley Butler
Automatonics, Inc.
"Find your head in the APL Cloud"
http://www.APLcloud.com
User avatar
woody
 
Posts: 144
Joined: Tue Dec 28, 2010 12:54 am
Location: Atlanta, Georgia USA

Re: ]user commands and MiServer programming

Postby Brian|Dyalog on Sun Jun 05, 2016 5:00 pm

Hi Woodley,

If you're just looking to load APL script file, there's no need to use a user command - that's a native capability with SALT. You can just do
      ⎕SE.SALT.Load 'filespec'
.

/Brian
User avatar
Brian|Dyalog
 
Posts: 120
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest