What does this syntax mean....

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

What does this syntax mean....

Postby ray on Tue Jun 02, 2015 11:42 pm

I do not know how to read the following line of code that appear in some MiServer example code:

(frm←Add Form).id←'myform'

When I try executing it I get the error
3:SYNTAX ERROR: Invalid modified assignment, or an attempt was made to change nameclass on assignment
Direction[6] (frm←Add Form).id←'myform'

"CurObj" claims
Form
is
#.HTML.Input.Form (Operator)

However I think Form is supposed to be a Class.
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 221
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: What does this syntax mean....

Postby Vince|Dyalog on Wed Jun 03, 2015 1:54 pm

Hi Ray,

I'll use an example outside of MiServer:

      'ns1' ⎕ns ''
'f' ⎕wc 'form'

⎕cr 'Add'
r←Add W
r←ns1


(frm←Add f).id←'myform'

frm
#.ns1

frm.id
myform


In your tests, is frm already defined?

Regards,

Vince
Vince|Dyalog
 
Posts: 412
Joined: Wed Oct 01, 2008 9:39 am

Re: What does this syntax mean....

Postby ray on Wed Jun 03, 2015 9:02 pm

Thanks Vince. That make sense as far as it goes.

As to my error

First my item "frm" is not already defined.

Within your example, "f" is a name class 9 object.
While my "Form" is already defined by MiServer
(within the scope of the Render method) as an operator

⎕CR'Form'
r←{atts}(method Form)innerhtml
:If 9=⎕NC'atts' ⋄ atts←'action="',atts.Page,'"' ⍝ MildPage calling
:ElseIf 0=⎕NC'atts' ⋄ atts←'' ⋄ :EndIf
atts,←' method="',method,'"'
atts,←('post'≡#.Strings.lc method)/' enctype="multipart/form-data"'
r←('form ',atts)Enclose innerhtml

but I think "Form" should actually be a reference to the class #._HTML.Form

I think my class is not inheriting correctly from the _HTML class.

Thanks
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 221
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest