Hi all,
Let me introduce my fun project,
webCRT unit. It's a server side web app utility unit to make
simple CGI web app development easy, as easy as making classic console program. This unit is especially targetted to both pascal and web
newbies who would like to try web app development. It's suitable for apps with single pass workflow, like a simple input → process → output flow. It's
not recommended to use this unit to create complex or huge or interactive web applications.
A simple web app using webCRT unit can be as simple as this:
program webapp;
uses webCRT;
var
s: string;
begin
ClrScr;
webWrite('Type your name: ');
webReadln(s);
if isWebInput then
webWriteln('Hello, '+s+'… nice to see you!');
webReadln;
end.
which would give you something like this:
http://i.imgur.com/SzUyPzU.png (on an Android device).
However, anyone could also use the unit to make simple web apps without using huge and complex web frameworks, like for prototyping, or brain storming, or just to play around with some algorithms. Of course
fpWeb,
Brook,
FastPlaz, or any web frameworks out there are great, but sometimes it's too complex and overkill to use them, especially when we just need to create a simple web app or service.
So, without further ado… here are the links to the source code and examples:
- webCRT unit source code:
http://pak.lebah.web.id/viewcode.cgi?file=webCRT.pas- features demo app:
http://pak.lebah.web.id/webdemo.cgiSome sample apps I've written using webCRT unit:
- word percentage calculator:
http://pak.lebah.web.id/wordpc.cgi - josephus problem:
http://pak.lebah.web.id/josephus.cgi (explain
here)
- 5n+1 vs 5n+3 problem:
http://pak.lebah.web.id/collatz3t.cgi (discussed
here)
- firebird access demo:
http://pak.lebah.web.id/fbcrud.cgi (this is a bit complex)
- maybe there are some more, just take a look at my code repo
here.
Those source code files above are also available through my gitHub
here.
Since this unit is for newbies, don't expect any advance features or fancy look. It's created for simplicity, after all. Though you may modify the source code any way you like. And… as usual, no documentation is available yet. Just examine the source code. Sorry.
If you find anything wrong with my code or want to suggest something (necessary features, optimizations, anything), feel free to communicate them to me.
Enjoy and have fun!
Regards,
-Bee
P.S.
By the way… it's fun to look how my fad project went from just over a hundred lines of code at the beginning of this year, is now growing to over a thousand lines of code. I didn't think this unit would become this big.