programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: webserver

From: Roger Dube <rdube_at_entropylock.com>
Date: Tue, 11 Nov 2003 14:57:36 -0500

Mike, the webserver you recently posted is working well, and I have the
Forth section operating as well now. Thanks for the help.

One more question... I would like to run more than one of these on the same
machine, and can avoid problems by choosing ports carefully. Ideally each
one would go off and read its own file to get its port assignment. Until I
can do that, where is the port setting "remembered" in the current
implementation?

Again, many thanks.

- Roger

----- Original Message -----
From: "Mike Ghan" <mikeghan_at_logix-controls.com>
To: <sftalk_at_forth.com>
Sent: Monday, November 10, 2003 1:56 PM
Subject: [sftalk] Re: webserver

> Roger,
>
> A script is run in a temporary dictionary who's size is determined by
> the value /SCRIPT-DICT. This allows the script to compile forth code
> or build data structures. The dictionary is forgotten (simple) at the
> end - do *NOT* chain into lower structures such as with [+SWITCH or
> IS.
>
> There shouldn't be any problems creating variables in a script. Note
> that variables (any code for that matter) are transient - a script is
> built in a temporary allocated dictionary space which is discarded
> after execution of the script. Global variables (any code for that
> matter) can be created in a file which in included at program startup.
> See the Readme.txt, Custom.F and the new example StartServer.Bat.
>
> Regarding form content, any field can be accessed with:
>
> \ Get the Content Value from Name=Value Pair received from the Client
> form.
> \ GET-CLIENT-CONTENT-VALUE ( NameAddr count -- ValueAddr count )
>
> All fields can be accessed with:
>
> \ Get the entire content received from the Client form.
> \ GET-CLIENT-CONTENT ( -- addr count )
>
> The strings returned from these functions can be processed anyway you
> see fit. You could, for example, open a file and use WRITE-LINE.
>
>
> Regarding file appending, the word >FILE" filename" redirects console
> output (i.e. EMIT and TYPE) to a new file. >>FILE" filename" will
> append to an existing file. ~>FILE and ~>>FILE will take a counted
> string as a filename (ex C" foobar.txt" ~>FILE ). CONSOLE restores
> console output.
>
>
> I updated our site to include examples of most of the above:
>
> http://www.logix-controls.com/SwiftForth\Webserver\WebServer.zip
>
> I understand there is a bit of undocumented code referenced in the
> examples so feel free to ask questions. I also added a few code
> comments to Readme.TXT
>
> Mike
>
> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
> Behalf
> Of Roger Dube
> Sent: Monday, November 10, 2003 4:13 AM
> To: sftalk_at_forth.com
> Subject: [sftalk] webserver
>
>
> I have been experimenting with Charles' webserver which allows the
> intermingling of Forth with HTML, and would like to extend the
> recording of form information beyond just a single recording of the
> comment field to include a growing file that records all of the
> fields. In the version that was posted, a file called comment.txt is
> created when a user completes the form, but it contains only the
> comment field, and is overwritten by the next user who submits a form.
> In trying to accomplish either unique files for each visitor or a
> single growing file, I found that I cannot declare a variable or allot
> memory within the forth environment for use by the code... is this a
> limitation forced by the way the Forth environment is created? Should
> I be employing DLL's to overcome this limitation?
>
> Any suggestions would be much appreciated.
>
> - Roger
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue Nov 11 2003 - 12:04:32 PST

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:34 PST