Jump to content
IGNORED

Mad Pascal


Recommended Posts

Posted (edited)

new directive $EVAL

 

functions supported: PI, RND, SQRT(x), SQR(x), ARCTAN2(x,y), COS(x), SIN(x), TAN(x), EXP(x), LN(x), ABS(x), INT(x), POWER(x,y), ARCTAN(x)

 

{$eval par1[,par2],"expression"}

 

uses crt;

const
	width = 40;
	height = 30;
	
	scr = $bc40;

var
	tab: array of word = [ {$eval HEIGHT, "scr + :1 * WIDTH" }  ];
	
	v: word;
begin

 for v in tab do writeln(v);

end.

 

Edited by tebe
  • Like 4
Link to comment
Share on other sites

I have received some requests for MP and WUDSN and when trying to answer them, I found that the docs are not entirely complete/correct.
Right now, I'm updating the WUDSN IDE Tools build with the latest MP (1.7.0) and MADS (2.1.5).
I've forked the docs and will send a pull request with my proposal. 

For that, I have a question: The "-define:SYMBOL" can only mark a symbol as defined but cannot currently set its value. Is that correct?

When I try to -define SYMBOL=TEST or -define SYMBOL="TEST", then SYMBOL is defined. In both cases with "SYMBOL=TEST". This makes it impossible to really use the value.
When I try to -define SYMBOL=123, then SYMBOLE is considered not defined in MP.

 

Is this really the expected behavior? It would surely be valuable to be able to set SYMBOL values (numbers and strings) from the command line.

Link to comment
Share on other sites

Posted (edited)
3 hours ago, JAC! said:

Is this really the expected behavior? It would surely be valuable to be able to set SYMBOL values (numbers and strings) from the command line.

-define:symbol is equivalent {$define name}

https://www.freepascal.org/docs-html/prog/progsu11.html

 

{$define name := ......} is macro

https://mads.atari8.info/doc/en/macros/#defining-a-macro

Edited by tebe
  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...