Ronan

160 Reputation

6 Badges

6 years, 162 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I am having a problem with image tools read a file from workbook.

In one document i get

Read("this:///101-Escher.bmp");
Error, (in ImageTools:-Read) unable to open database file

In another document I cant save the file. 

I have just installed jEdit. Have written 2 files.Started with "open in mode  maple". So text gets nicely coloured. Can save the files ok as .mpl. I have several questions
1) How do I make the code indent/format?

2)How should I test the code? Can jEdit show me errors? I am running jEdit and maple side by side. Save, Read, hit bug...

3)How do I format an imported .mpl from maple?

4)How do I get $include to work?

Testr1:=proc(a,b)
description "Jedit test";
local A,B;
A:=a;B:=b;
if is(A<B) then print ('smaller')
elif is(A>B) then print('bigger')
else print('cant_say')
end if;
return cos(A+B), sin(A-B),A,B;
end proc;
TestjEdit:=module()
option pagkage;
export Testr1;
$include "Testr1.mpl"
end module;
#imported file
Antisym := proc (V::{Matrix(3,3,shape = antisymmetric,algebraic), Vector(3)})
local M; description "converts vector to antisymmetric matrix and back"; if 
type(V,Vector) then M := Matrix(3,3,shape = antisymmetric); M[1,2] := -V[3]; M
[1,3] := V[2]; M[2,3] := -V[1] else M := Vector(3,[-V[2,3], V[1,3], -V[1,2]])
end if; M end proc;

restart

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trigonometry"

(1)

read "C:\\Users\\Ronan\\Documents\\jEdit\\Testr1.mpl"

proc (a, b) local A, B; description "Jedit test"; A := a; B := b; if is(A < B) then print('smaller') elif is(B < A) then print('bigger') else print('cant_say') end if; return cos(A+B), sin(A-B), A, B end proc

(2)

"print("'Testr1'")"

(3)

Testr1(2, 4)

cos(6), -sin(2), 2, 4

(4)

Testr1(x, 5)

cos(x+5), sin(-5+x), x, 5

(5)

Testr1(x, x+1)

cos(2*x+1), -sin(1), x, x+1

(6)

restart

read "C:\\Users\\Ronan\\Documents\\jEdit\\TestjEdit.mpl"

$include "Testr1.mpl";
^

Error, while reading ``C:\Users\Ronan\Documents\jEdit\TestjEdit.mpl``

 

TestjEdit:-Testr1(2, 1)

Error, `TestjEdit` does not evaluate to a module

 

``


 

Download Jedit_testing.mw
 

restart

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trigonometry"

(1)

read "C:\\Users\\Ronan\\Documents\\jEdit\\Testr1.mpl"

proc (a, b) local A, B; description "Jedit test"; A := a; B := b; if is(A < B) then print('smaller') elif is(B < A) then print('bigger') else print('cant_say') end if; return cos(A+B), sin(A-B), A, B end proc

(2)

"print("'Testr1'")"

(3)

Testr1(2, 4)

cos(6), -sin(2), 2, 4

(4)

Testr1(x, 5)

cos(x+5), sin(-5+x), x, 5

(5)

Testr1(x, x+1)

cos(2*x+1), -sin(1), x, x+1

(6)

restart

read "C:\\Users\\Ronan\\Documents\\jEdit\\TestjEdit.mpl"

$include "Testr1.mpl";
^

Error, while reading ``C:\Users\Ronan\Documents\jEdit\TestjEdit.mpl``

 

TestjEdit:-Testr1(2, 1)

Error, `TestjEdit` does not evaluate to a module

 

``


 

Download Jedit_testing.mw

 


Hi. I would like to learn to use your package. The example  document for it not running (for me). Included a screen shot and my test document. Basicially It would like to import .mpl procedures and use them as the exports of a module/package. I have no experience with code editors and this is the first time I have tried to use the code edit region. Also whathat does the (**) mean/do?

Edit: I redid the documet.


 

restart

``

with(CodeBuilder)

[Build, Directory, Export, File, Import, Mint, Read, Regions, Version]

(1)

"Directory("interface('worksheetdir')")"

"C:\Users\Ronan\AppData\Local\Temp\Rtestm"

(2)

Regions()

["Rtestm.mpl", "NewTest.mpl", "NewTest_ModuleApply.mpl"]

(3)

libname

"C:\Program Files\Maple 2017\lib", "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib", "C:\Users\Ronan\maple\toolbox\personal\lib"

(4)
Rtestm := module ()

_m2199891725024

["C:\Users\Ronan\AppData\Local\Temp\Rtestm\Rtestm.mpl", "C:\Users\Ronan\AppData\Local\Temp\Rtestm\NewTest.mpl", "C:\Users\Ronan\AppData\Local\Temp\Rtestm\NewTest_ModuleApply.mpl"]

``

NewTest:=module()

"This is a NEW TEST"

_m2199890918688

``

``

ModuleApply:=proc()

proc () print("This is a NEW TEST") end proc

``

"" CodeBuilder:-Build"('mint','maplet', 'infolevel'=2,  'prefix' = "#!",  'main' = "Rtestm.mpl");"

mint, maplet, infolevel = 2, prefix = "#!", main = "Rtestm.mpl"

(5)

Rtestm:-Rtest()

"this is a test"

(6)

""Rtestm:-NewTest"()"

``

``

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trinonometry"

(7)

restart

Read*"C:\\Users\\Ronan\\AppData\\Local\\Temp\\Rtestm\\Rtestm.mpl"

Read*"C:\Users\Ronan\AppData\Local\Temp\Rtestm\Rtestm.mpl"

(8)

Rtestm:-Rtest()

Error, Rtest is not a command in the Rtestm package

 

Rtestm:-NewTest()

Error, NewTest is not a command in the Rtestm package

 

``


 

Download 1-CodeBuilder_Pkg_test.mw

@Joe Riel 

I have a module with quite a few procedures and it is getting too long and complex. Basicially I write each procedure in a seperate document, them copy and paste it into the module. I want to improve matters as save each proc and read it in to the module

e.g.  Qdim:=proc(A,B).........end proc

        save Qdim , "Qdim.?"   have tried .txt ,.mla , .m  They save fine.

in the module have tried

read "Qdim.txt" etc.   I have included Qdim in export but Qdim doesnt work Qdim(A,B) returns Qdim(A,B)

read "C:\Users\Ronan\Documents\MAPLE\Rational Trinonometry\Qdim.m";

which procuces an error

Error, (in unknown) could not open `C:UsersRonanDocumentsMAPLERational TrinonometryQdim.m` for reading

 

1 2 3 4 5 6 7 Last Page 3 of 12