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

Re: webserver

From: Mike Ghan <mikeghan_at_logix-controls.com>
Date: Tue, 11 Nov 2003 14:46:58 -0800

I discovered a potential problem while preparing to interpret the
command line. Still, I don't think it would cause your problem. I
updated our site:

http://www.logix-controls.com/SwiftForth\Webserver\WebServer.zip

Are you sure you are including a file? Try launching the WebServer
via a batch file containing:

START WebServer Custom.F

Custom.F should contain:

81 WEB-MASTER TCP-PORT ! \ Set HTTP Port

Mike

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
Behalf
Of Roger Dube
Sent: Tuesday, November 11, 2003 1:21 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: webserver

Mike, indeed the port was NOT changed, so perhaps I'm INCLUDING the
command
at the wrong point... if I place the command in an existing file as a
start,
which file would I use to get far enough upstream? Or, in which file
should
I place the INCLUDE command?

- Roger

----- Original Message -----
From: "Mike Ghan" <mikeghan_at_logix-controls.com>
To: <sftalk_at_forth.com>
Sent: Tuesday, November 11, 2003 4:09 PM
Subject: [sftalk] Re: webserver

> Hmmm. I successfully tested this. The command line is parsed
*before*
> the server is launched. Did you verify the port was changed
> Tools>Network Configuration ?
>
> Mike
>
> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
> Behalf
> Of Roger Dube
> Sent: Tuesday, November 11, 2003 12:48 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: webserver
>
>
> Doesn't seem to work.. problem seems to be that the webserver starts
> up
> before it goes off and includes custom.f... by then, we already have
a
> problem.
>
> Is there a file that Webserver invokes first as it starts that
perhaps
> I
> could use to set the port?
>
> - Roger
>
> ----- Original Message -----
> From: "Mike Ghan" <mikeghan_at_logix-controls.com>
> To: <sftalk_at_forth.com>
> Sent: Tuesday, November 11, 2003 3:32 PM
> Subject: [sftalk] Re: webserver
>
>
> > The port assignment is stored in a class variable TCP-PORT. The
> class
> > instance utilized is named WEB-MASTER. This variable instance
> (among
> > other things like window position) is save/restored to the
registry
> > during program start/termination. Try placing the following in a
> file
> > INCLUDEd at startup (Custom.F in my previous examples):
> >
> > 81 WEB-MASTER TCP-PORT ! \ Set HTTP Port
> >
> >
> > Mike
> >
> > -----Original Message-----
> > From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On
> > Behalf
> > Of Roger Dube
> > Sent: Tuesday, November 11, 2003 11:58 AM
> > To: sftalk_at_forth.com
> > Subject: [sftalk] Re: webserver
> >
> >
> > 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
----------------------------------------------------------------------
Received on Tue Nov 11 2003 - 14:53:32 PST

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