[Pas2js] pas2js app debugging

Michael Van Canneyt michael at freepascal.org
Sat Feb 24 12:27:14 CET 2018



On Sat, 24 Feb 2018, Mr Bee via Pas2js wrote:

> 2018-02-23 15:47 GMT+07:00 Michael Van Canneyt <michael at freepascal.org>:
>>
>>
>> You don't need TMS WebCore for that. You just need to tell the compiler
>> to create a source map, and upload the source map together with the program
>> to the website. Then it will work automatically in the browser.
>>
>
> Great news! It needs to be shown off! :)

I know. Available time is a problem.

>> But the download of snapshots will get you a long way: (see wiki)
>> http://wiki.freepascal.org/pas2js#Snapshots
>> a binary for the most popular targets is available.
>
>
> I found 2 repos, one is yours Michael and the other is on ftpmaster. It
> seems that v.0.9 on ftpmaster requires FPC trunk, it fails to work with FPC
> stable, also missing some files (can't include rtl.js for instance). While
> yours can work with FPC stable. Is it correct? If it is, I hope next
> version would work with FPC stable. FYI, I'm now using pas2js with FPC
> v.3.0.4 on Linux Ubuntu.

Indeed. I will fix the missing rtl.js. Strange no-one reported this yet!

What do you mean with "my repo" ?

In each case, pas2js requires trunk. This is for sure.


>
> My next question is… is it possible to create something like CRT unit to
> work on browser using pas2js? I'd like to see Pascal newbies be able to
> create classic Pascal program (with simple write/ln and read/ln calls) that
> works in the browser.
>
> I have a project, just for fun. It's WebCRT unit and it's available on
> github here: https://github.com/pakLebah/webCRT
>
> If it's possible to create something similar to it working on browser, I'd
> like to try it. What do you think? Any hints or suggestions?

Check the browserconsole unit. 
For the moment, it just allows writeln() to write to a "console",
My plan was to improve it so it can also do a 'readln' - this should be
fairly easy.

and I think a CRT unit is also a possibility.

A CRT unit would just need to define a matrix of DIV elements 
<div id="crt_r1"><div id="crt_1_1></div>...<div id="crt_80_1></div></div>, 
and set the inner html of the correct div. Using CSS color can be easily simulated.

If you want to take a shot at it, and need help/ideas, just ask.

BTW. Please mail with your correct address to the mailing list, you are
subscribed with a gmail address, but your posts are with a yahoo address.
Now I need to moderate your messages...

Michael.


More information about the Pas2js mailing list