Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
fortrancgi
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ali Suhardiman  
View profile  
 More options Feb 4 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: "Ali Suhardiman" <bellda...@ames.net>
Date: 1999/02/04
Subject: fortrancgi
anybody knows how to parse input in cgi using fortran and then convert it
into integer?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kmatick  
View profile  
 More options Feb 7 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: kmat...@binghamton.edu
Date: 1999/02/07
Subject: Re: fortrancgi

A general sort of suggestion, since nobody else replied ...

First get all of the input into a sufficiently large character string.

Then use "internal read" to get the integer data from this string.

In article <36b997dd.0@news>,
  "Ali Suhardiman" <bellda...@ames.net> wrote:

> anybody knows how to parse input in cgi using fortran and then convert it
> into integer?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clive Page  
View profile  
 More options Feb 8 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: Clive Page <c...@nospam.le.ac.uk>
Date: 1999/02/08
Subject: Re: fortrancgi

In article <36b997dd.0@news>, Ali Suhardiman <bellda...@ames.net> wrote:
>anybody knows how to parse input in cgi using fortran and then convert it
>into integer?

Have a look at http://www.nag.co.uk/nagware/Examples.html for a cgi module.
Converting string to integer has been done to death in other threads in
this group recently (hint: just use an internal file read).

--
Clive Page,                         e-mail:  cgp (at) le (dot) ac (dot) uk
Dept of Physics & Astronomy,              
University of Leicester.                  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
LC's No-Spam Newsreading account  
View profile  
 More options Feb 9 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: LC's No-Spam Newsreading account <nos...@ifctr.mi.cnr.it>
Date: 1999/02/09
Subject: Re: fortrancgi

On Thu, 4 Feb 1999, Ali Suhardiman wrote:
> anybody knows how to parse input in cgi using fortran and then convert it
> into integer?

Your question is too precise and to vague at the same time. Using a Fortran
program as a CGI executables (something I've always planned to do but
not done yet, at least without an intermediate shell script, which is
what I did so far) would imply three issues :

(1) one (which you do not mention) is the communication between html and
    the CGI fortran program. There was an announcement on this NG of an
    URL explaining the basic of it :

    http://www.fcc.gov/mmb/asd/bickel/fortran.html

    This URL addresses clearly the possibilities of POST and GET. It does
    mention the portability problems, but does not supply a portable solution
    for it (but a working solution on some platforms). I had some private
    e-conversation with the author ... may be he had time to work on.

    If THAT was your problem please re-post.

(2) I assume you have already found a way to cope with (1) so you have now
    in your program a long CHARACTER*n string of "true" length m<n, in the
    form :

      variablename1=value1&variablename2=value2&....

    Writing a parser using INDEX and the other character intrinsics should
    be an easy exercise. I won't consider this a problem (no, I haven't a
    canned solution ... although I have other parsers)

    My suggestion would be to have two parsing routines, a general one

       CALL GET_NEXT_VAR(name,value,error)

    which at the first call returns name='variablename1' and value='value1'
    as strings (if number, READ(value,*)NUMBER), at the second the next
    variable and so on.

    and another one  

       CALL GET_NAMED_VAR(name,value,error)

    which called with name with an intent of input will return the value
    of the variable (e.g. CALL GET_NAMED_VAR('variablename2',value,error)
    will return value='value2'

(3) or perhaps you are referring to the final detail which should be hidden
    in a service routine called by the previous two ... The URL-encoded
    string will contain some %hh sequences instead of some characters.

    Again it should be an easy exercise to :

       store the hex value hh in a CHARACTER*2 HEXSTRING

       convert HEXSTRING in an integer decimal value NDEC

       generate the corresponding ascii character CHAR(NDEC)

       and replace '%nn' with CHAR(NDEC)

    Again I have no pre-canned solution. but for the hex to decimal
    conversion. I will post immediately after a prototype ...

--
----------------------------------------------------------------------
nos...@ifctr.mi.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "hex to decimal Re: fortrancgi" by LC&#39;s No-Spam Newsreading account
LC's No-Spam Newsreading account  
View profile  
 More options Feb 9 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: LC's No-Spam Newsreading account <nos...@ifctr.mi.cnr.it>
Date: 1999/02/09
Subject: hex to decimal Re: fortrancgi
       SUBROUTINE HEXI4(HEX,I4)
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine HEXI4
C.LIBRARY:        GENERAL                  
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 16 Apr 96 - original versions
C.PURPOSE:        convert hexadecimal to integer
C.METHOD:         lookup in string and arithmetics
C.SYNTAX:         CALL  HEXI4(HEX,I4)
C.PARAMETERS:     CHARACTER HEX*n    : string with hex value (in)
C                 INTEGER   I4       : converted binary value (out)
C.RESTRICTIONS:   n in range 1 to 8
C                 string must be 0-padded on the left
C.NOTES:          converts to native representation of the system
C.FILES:          
C.REFERENCES      
C
C----------------------------------------------------------------------
C
       CHARACTER*(*) HEX
       INTEGER       I4
       CHARACTER*16  VAL
       INTEGER       L,I,DIGIT,EX
       DATA VAL /'0123456789ABCDEF'/
C
       L=LEN(HEX)
       CALL UPCASE(HEX)
       I4=0
       DO 1 I=L,1,-1
       EX=L-I
       DIGIT=INDEX(VAL,HEX(I:I))-1
       I4=I4+(16**EX)*DIGIT
 1     CONTINUE
       RETURN
       END

--
----------------------------------------------------------------------
nos...@ifctr.mi.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr Ivan D Reid, muSR Facility  
View profile  
 More options Feb 9 1999, 3:00 am
Newsgroups: comp.lang.fortran
From: r...@psi.ch (Dr Ivan D Reid, muSR Facility)
Date: 1999/02/09
Subject: Re: hex to decimal Re: fortrancgi
In article <Pine.OSF.4.05.9902091026430.19818-100...@poseidon.ifctr.mi.cnr.it>,
         LC's No-Spam Newsreading account offered:

        read(hex,'(Z)')I4
c add error-handling routines as appropriate...

>       RETURN
>       END

--
Ivan Reid, Paul Scherrer Institute, CH.   http://musr0.psi.ch/  r...@psi.ch
        KotPT -- "for stupidity above and beyond the call of duty".

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »