HOME
ABOUT GCS
INTERFACE
DESCRIPTION
EXAMPLES

Dialogue Interface

GCS is designed to make maximum use of existing and easily available tools in the WWW system. CGI TEXTAREA is a very convenient tool to edit short C source programs and send them out over the net.
When it is needed to make calculations with some of the input data modified, you modify the relevant part of the C source code and submit it to GCS.
I like this method because you can be aware of what you are doing, what algorithms you are using.

However I also agree dialogue interfaces are more friendly in many instances. Dialogue interface and script interface have each its pros and cons. I am aware that, although I generally prefere script interfaces, this is not true for many people.

So, I thought of making use of other CGI form tools such as INPUT and SELECT in the GCS system. I inserted a code that, upon receiving the user POST data, keywords in the source text sent in TEXTAREA be replaced by the data sent in other forms such as INPUT and SELECT.

To those who feel this uneasy, I review briefly here how the form tag fields are constructed.
The source html of the GCS interface referred by the header link box looks like this.
 

<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Write C source code and press this button. 
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF></textarea><br>
</form>

There are two fields or items between the form start tag and the form end tag. The first one is an input tag. It's type is SUBMIT and its data is referred by the name "code" at the server side. The second item is a textarea. It's data consists of the C source code and is referred by the name "source".
Besides SUBMIT, there are other types in the input tag. They are TEXT, PASSWORD, CHECKBOX, RADIO and others.
Generally, they collect some text data and send them to the server with the associated names. The server can retrieve the text using the name as the keyword.

This html code can reside anywhere. You can put it in your local text file and you may display it on your web browser by opening the file from the browser's file menu. If you press the "Compute" button GCS executes the submitted source code and returns the result in your browser's new window.

Instead of typing your source code in the displayed textarea, you can put the code in the html source text as the default text in the following way.
 

<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Write C source code and press this button. 
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF>
int main()
{
 printf("Hello,World!\n");
}
</textarea><br>
</form>


Now we will introduce the dialogue interface in this example.
 

<form action="http://kiku.ath.cx/cgi-bin/p068" target="new" METHOD=POST>
Put your name in the box and press the "Compute" button.
<input type=TEXT name="World"><br>
<input type=SUBMIT name="code" value="Compute"><br>
<textarea rows=30 cols=70 name="source" wrap=OFF>
int main()
{
 printf("Hello,World!\n");
}
</textarea><br>
</form>


Blue colored texts are where the changes are made from the original form. I have added a text box before the submit button. It has the name "World" as highlighted in red. If you put your name in the text box, the word "World" in the C source code, also highlighted in red, will be replaced by your name. The effect is that GCS greetes you using your name.

Here you substituted the key word with your name. You can substitute a keyword by a numeral and you can make some computation using the submitted numeral as the input. You may substitute a keyword with a longer sentence or sentences. You may substitute the right-hand side of an equation by another mathematical expressions.
I have put some examples in the EXAMPLES section.

DIALOGUE INTERFACE
MORE FUNCTIONS