home *** CD-ROM | disk | FTP | other *** search
- /*
- ** html_formular.ced
- **
- ** $VER: html_formular.ced 1.6 (01.05.1999)
- **
- ** Arexx script for HTML v3.2 formular structure
- **
- ** This script works with CygnusEd Professional v4.2
- **
- ** Copyright ⌐ Eric BELLE
- */
-
- /*
- **------------------------------------------------------------------------------
- ** Initialisation
- **------------------------------------------------------------------------------
- */
-
- OPTIONS RESULTS /* Tell CygnusEd to return results. */
- NL = '0A'X /* Alias for new line. */
- KRETURN = RAWKEY 68 /* Shortcut to the return key. */
- KTAB = RAWKEY 66 /* Shortcut to the tab key. */
- STATUS TABSARESPACES /* Return TAB mode ("tab" or "space"). */
- IF RESULT = 1 /* Test the TAB mode. */
- THEN "TABS = SPACES" /* Switch TAB mode from "space" to "tab". */
- ELSE NOP /* No operation. */
- TAB SIZE 1 /* Set TAB size proportional to 2 spaces. */
-
- /*
- **------------------------------------------------------------------------------
- ** Formular destination
- **------------------------------------------------------------------------------
- */
-
- FormularDestination="no"
- DO WHILE (FormularDestination="no")
- OKAY2 "Formular destination: " || NL ||,
- "~~~~~~~~~~~~~~~~~~~~ " || NL ||,
- " (0) - local | (2) - universal " || NL ||,
- " (1) - absolute | (3) - e-mail "
-
- IF (RESULT=0)
- THEN EXIT 0
- ELSE FormularDestination="ok"
-
- GETNUMBER 0 '"Destination mode?"' 0 3
- DestinationMode = RESULT
-
- IF (destinationMode=" ")
- THEN FormularDestination = "no"
- ELSE NOP
- END
-
- /*
- **------------------------------------------------------------------------------
- ** Html formular marks
- **------------------------------------------------------------------------------
- */
-
- SELECT
- WHEN (DestinationMode=0) THEN DO
- GETSTRING "Script" '"Destination script name with its relative path?"'
- DestinationScript = RESULT
-
- IF (DestinationScript=" " | DestinationScript="RESULT")
- THEN EXIT 0
- ELSE NOP
-
- DestinationString = ' ACTION="' || DestinationScript || '"'
- END
- WHEN (DestinationMode=1) THEN DO
- STATUS DIRNAME
- DestinationDir = RESULT || "/"
-
- GETFILENAME DestinationDir '"Select script"'
- DestinationScript = RESULT
-
- IF (DestinationScript=" " | DestinationScript="RESULT")
- THEN EXIT 0
- ELSE NOP
-
- DestinationString = ' ACTION="http://localhost/' || DestinationScript || '"'
- END
- WHEN (DestinationMode=2) THEN DO
- GETSTRING "Script" '"Destination script name with its universal path?"'
- DestinationScript = RESULT
-
- IF (DestinationScript=" " | DestinationScript="RESULT")
- THEN EXIT 0
- ELSE NOP
-
- DestinationString = ' ACTION="http://' || DestinationScript || '"'
- END
- WHEN (DestinationMode=3) THEN DO
- GETSTRING "e-mail" '"Electronic address?"'
- DestinationScript = RESULT
-
- IF (DestinationScript=" " | DestinationScript="RESULT")
- THEN EXIT 0
- ELSE NOP
-
- DestinationString = ' ACTION="mailto:' || DestinationScript || '"'
- END
- OTHERWISE NOP
- END
-
- /*
- **------------------------------------------------------------------------------
- ** Sending method
- **------------------------------------------------------------------------------
- */
-
- SendingMethod = "q"
- DO WHILE ~(SendingMethod="g" | SendingMethod="p",
- | SendingMethod=" " | SendingMethod="RESULT")
- GETSTRING "g" '"Sending method: (g)et, (p)ost?"'
- SendingMethod = RESULT
- END
-
- IF (SendingMethod="RESULT" | SendingMethod=" ")
- THEN EXIT 0
- ELSE NOP
-
- /*
- **------------------------------------------------------------------------------
- ** Html sending marks
- **------------------------------------------------------------------------------
- */
-
- SELECT
- WHEN (SendingMethod="g") THEN SendingString = " METHOD=GET"
- WHEN (SendingMethod="p") THEN SendingString = " METHOD=POST"
- OTHERWISE NOP
- END
-
- OpenString = "<FORM" || DestinationString || SendingString || ">"
- CloseString = "</FORM>"
-
- /*
- **------------------------------------------------------------------------------
- ** Buttons to reset end validate formular
- **------------------------------------------------------------------------------
- */
-
- GETSTRING "y" '"Buttons to reset and validate the formular: (y)es, (n)o?"'
- Buttons = RESULT
-
- SELECT
- WHEN (Buttons="RESULT") THEN EXIT 0
- WHEN (Buttons=" ") THEN EXIT 0
- WHEN (Buttons="y") THEN DO
- GETSTRING "Send" '"Button text to validate the formular?"'
- ValidButtonText = RESULT
-
- IF (ValidButtonText="RESULT" | ValidButtonText=" ")
- THEN EXIT 0
- ELSE NOP
-
- ValidButtonString = '<INPUT TYPE=SUBMIT VALUE="' || ValidButtonText || '">'
-
- GETSTRING "Reset" '"Button text to reset all formular inputs?"'
- ResetButtonText = RESULT
-
- IF (ResetButtonText="RESULT" | ResetButtonText=" ")
- THEN EXIT 0
- ELSE NOP
-
- ResetButtonString = '<INPUT TYPE=RESET VALUE="' || ResetButtonText || '">'
- END
- OTHERWISE NOP
- END
-
- /*
- **------------------------------------------------------------------------------
- ** Html formular stucture
- **------------------------------------------------------------------------------
- */
-
- TEXT OpenString ; "AUTO-INDENT" ; KTAB
- TEXT "Should be modified - Formular" ; "AUTO-INDENT"
- IF (Buttons="y")
- THEN DO
- "AUTO-INDENT"
- TEXT ValidButtonString
- "AUTO-INDENT"
- TEXT ResetButtonString
- "AUTO-INDENT"
- END
- ELSE NOP
- BACKTAB ; TEXT CloseString
-
- /*
- **------------------------------------------------------------------------------
- ** End of html_formular.ced Arexx script
- **------------------------------------------------------------------------------
- */
-
- EXIT 0
-