Hi , I need help to write a code for this function(fortran 77):(adsbygoogle = window.adsbygoogle || []).push({});

integer function delete(id, list, n) where

• delete returns 0 if the deletion was successful, -1 if the list is empty, and -2 if the user is not currently in the list.

•id is the integer identification number of the user.

•list is the integer array from which the id is to be removed.

•n is the current length of the list.

I tried this:

I have not finfished because I am stuck . I dont know where to introduce the else statement that would indicat the id is not in the list.Code (Text):

integer function delete(id,list,n)

integer i,indexe,j

do 20 i=1,n

if(list(i).EQ.id) then

indexe=i

20 continue

do 30 j= indexe,n

list(i) = list(i+1)

30 continue

n = n-1

return 0

My second problem is that How to check if that array is empty?

please can someone help me?

Thank you for the time.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran help

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for Fortran help | Date |
---|---|

Fortran I need help in Fortran please -- Bairstow's method & Newton-Raphson | Nov 26, 2016 |

Fortran Need help with FORTRAN | Jun 8, 2016 |

Fortran Fortran compile error I can't figure out | Jan 15, 2016 |

Fortran Help about Fortran | Sep 13, 2015 |

Fortran [Fortran] Help Reading Complex 2D data | Jul 14, 2015 |

**Physics Forums - The Fusion of Science and Community**