## 276 Reputation

17 years, 364 days

## thank you...

@Earl  I am hoping that the full set of rules for using events will appear-perhaps inMaple 2021-and will answer all my questions. Meanwhile, it is useful to see your apllication of the command.

## ah ha!...

Thanks.

So I am not the only one who finds the Help pages opaque.

BTW, I still rely on an answer you suplplied 9?15/17 to use events. I am hoping to be able to use the commands more comfortably in Maple 2021.

## Thanks for the simple example....

@Kitonum I just have to remember it. Wouldn't it be nice if it was one of the examples on the Help page?

## Much clearer...

@acer
Thank you for clarifying the syntax.
I am familiar with the archaic usuage of the dot to denote concatenation but that was not my intent; I was merely eliminating spaces and hoping that would be more acceptable to Maple.

## very clear...

Thanks for your help. The 2D supresses y(x) but not dy(x)/dx.

## It worked!...

Many thanks for help with my mini-issue. I now have a working file.  Hooray!

## useful comment but......

@nm.   lists are not mutable, Vectors and Matrices are. For big projects that can make quite a difference.

The suggestion (by acer or Joe Riel) to make a copy of the structure is just what is needed.

## Got it!...

Strange that the compact option is cancelled implicitly when you multiply by 2.

Thanks for the explanation and also for the pointer to Section 6.7 of the Programming Manual which is quite helpful.

## ah ha?...

@acer Thank you for your explanation. I guess the copy command is just necessary for vectors and matrices; it is not necessary for lists or scalars.

I thought I understood until I tried to apply my new "knowledge" in a slightly different context.

I wanted to construct a matrix by altering the identity matrix a bit.  Putting A:=IdentityMatrix(5); A[2,3]:=7; resulted in an error message. You explained why above so..

A:=copy(IdentityMatrix(5)); should work. Nope.

A[2,3]:=7; still resulted in an error message.
My very silly workaround:
B:=2 IdentityMatrix(5); B[2,3]:=14; A:= 1/2 B;
There must be a better way.

## Thanks....

@Joe Riel
the inplace option makes all clear.

## I apologize for the confusion....

@acer I find this issue so strange that I have tried many things. My original post was about typing directly into the Maple worksheet. I later copied and pasted that file into Mapleprimes for the perusal of experts and because I was not able to upload my .Maple file. When I saved the file as .mw I was able to upload. I also opened a plaintext editor to try and see if I was typing something strange but the only peculuarity was the added semiclon and added blank line that you noticed.

## Sorry to so thick...

@acer  I am not sure what you mean  by the "actual text file". I use the Maple interface to type my commands and that file is what I uploaded. What else can I do? I do not use an external editor.

## plaintext file...

@acer Here are the contents of a plaintext file:

Copying from 2D worksheet into a plain text file:

q:=proc(x) sin(x);

end proc;

q:=proc(x) x+3;

end proc;

Copying from 1D worksheet into a plain text file:

q:=proc(x)
x+3
end proc;

(No space and no semicolon.)

Typing directly into a plain text file:

Q:=proc(x)
sin(x)
End proc;

Maple seems to alter what I type into 2D.

FWIW I am uploading a minimal file with the problem. As soon as I switch from 2D to 1D the problem goes away. I don't know how you see the newline characters.

BTW, the uploaded contents of the file do not look like what I see on my screen; I have cut and pasted that as well.

 >
 Error, unterminated procedure Error, unable to parse
 >
 Error, unterminated procedure Error, unable to parse
 > restart;
 > q:=proc(x)x+34end proc;
 (1)
 >

q:=proc(x)
sin(x)
end proc;

Error, unterminated procedure
Typesetting:-mambiguous(qAssignTypesetting:-mambiguous(

procApplyFunction(x) sinApplyFunction(x),

Typesetting:-merror("unterminated procedure")))
Error, unable to parse
Typesetting:-mambiguous(  Typesetting:-mambiguous(end,

Typesetting:-merror("unable to parse")) procsemi)
q:=proc(x)
x+3
end proc;

Error, unterminated procedure
Typesetting:-mambiguous(qAssignTypesetting:-mambiguous(

procApplyFunction(x) x + 3,

Typesetting:-merror("unterminated procedure")))
Error, unable to parse
Typesetting:-mambiguous(  Typesetting:-mambiguous(end,

Typesetting:-merror("unable to parse")) procsemi)
restart; #Switching to 1 D input
q:=proc(x)
x+3
end proc;
q := proc(x)  ...  end;

No problem!

## one more try...

 >

Using Maple 2018.1 on an iMac running mac Sierra.

 >
 >

First strange occurence with description.

 >
 >

 >
 >
 >
 >
 >
 >
 >

 >
 (1)
 >
 (2)
 >
 (3)
 >
 >
 >