![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

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
----------------------------------------------------------------------
Received on Mon Nov 10 2003 - 11:02:32 PST
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:34 PST