Author Topic: Calculator applet from url  (Read 2205 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Calculator applet from url
« on: July 11, 2014, 03:21:14 pm »
Inspired by haroldbot, regular expressions and javascript applets for converting hex to decimal I introduce: Calculator applet generator.


I have not coded it up but this is what is might look like.
Example: Relative jump calculator applet:
Code: [Select]
1x(0..65535)  "Jump From:",
2x(0..65535)  "To:",
0x(-127..128) "Offset:"
:$2 - $1 [ ! - 2]


This describes the following applet:

Jump From:
[Hexadecimal input] (range 16 bits)
To:
[Hexadecimal input] (range 16 bits)
Enable -2? [Yes]

Offset:
[Hexadecimal output] (range 8 bits signed)


The url to this applet would look like this: mypage.com/?d='1x(0..65535)  "Jump From:",2x(0..65535)  "To:",0x(-127..128) "Offset:" :$2 - $1 [ ! - 2]'

What do you think?
If you like my work: why not give me an internet?