[fpc-pascal] Bls: Writing fpWeb app without Lazarus

Mr Bee pak.lebah at yahoo.com
Wed Jun 8 08:37:00 CEST 2016


Pada Selasa, 7 Juni 2016 15:23, Michael Van Canneyt <michael at freepascal.org> menulis:



> What is the URL you used to access your app ?
http://beeography.koding.io/hello.cgi (/mod) (/act [/act1 | act/act2])

And here's the source code: http://pastebin.com/N7EQz4Lk Feel free to correct any mistakes in my code. Thank you.
> What is the output in the browser ?
Just a "hello world" message.

> Then, never create an instance of a webmodule manually, always let the
framework create instances.
Yes, the problem has been solved with a help from Mario's ebook (https://bitbucket.org/leledumbo/books/downloads/fpwebtutorial-chromeprint.pdf). Mario is also known as @leledumbo at Lazarus' forum.
> Also, a statement as
> HelloModule := THelloModule.Create(nil);
> is wrong, since it will attempt to stream the module. If you do want to
> create modules manually, do
> HelloModule := THelloModule.CreateNew(nil,0);

Yes, I should have figured it out earlier, but it's been a long time since the last time I used TDataModule, so there are many things that I forgot about VCL. In fact, that's the main source of my problem. Once I used the CreateNew constructor, everything works as expected. Though I still have many things to learn to understand how the fpWeb works. :)

> No, this is not possible. 
> It was explicitly designed to use classes in a RAD environment.
> It is perfectly possible to drop the RAD part and use the classes as-is, but
> it is not possible not to use the classes.
I don't mind the clasess, but I do mind the RAD part. A web app development should be able to be done without the RAD part because in some cases we don't always have the access to use the RAD.

> There are multiple examples in the FPC source tree; 
> Why don't you use those as a starting point ?
I did. But all the examples I found are using Lazarus aka RAD. Hence this email.
fpWeb —and all the gems of FCL— do really need proper and complete documentations. It's hard —especially for Pascal newbies— to learn FCL from the source code alone. Documentation is the main and first obstacle for everyone who like to use FCL to its potential. I wish I could help.
Thank you for the reply, Michael. 
Regards,
–Mr Bee

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160608/be427b30/attachment.html>


More information about the fpc-pascal mailing list