Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Need HELP!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need HELP!

    I need help on how to read data with a loop, and in the loop have
    a place, where I can get the longest piece of data(which are
    names),and shortest name, and print them outside of the data
    loop. Lets say there are 14 names. I am lost. What can I do?
    example:
    read n$
    if n$=blah then ok

    let A=LEN(N$)

    PRINT ," "n$,,A

    This is what I have so far. I just don't know what to do next.

    -------------
    Kro121
    Kro121

  • #2
    Code:
    DIM NAME$(14)
    FOR COUNT% = 1 TO 14
     READ NAME$(COUNT%)
    NEXT COUNT%
    Code:
    L% = 1
    S% = 1
    FOR COUNT% = 2 TO 14
     IF LEN(NAME$(COUNT%)) > LEN(NAME$(L%)) THEN L% = COUNT%
     IF LEN(NAME$(COUNT%)) < LEN(NAME$(S%)) THEN S% = COUNT%
    NEXT COUNT%
    Code:
    PRINT "The longest  name is ";NAME$(L%)
    PRINT "The shortest name is ";NAME$(S%)

    Code:
    DATA Chris Boss, Mike Doty, Lance Edmonds, Tom Hanlin
    DATA E B Knoppert, Mike Luther, Michael Mattias, Dave Navarro
    DATA Eric Pearson, Patrice Terrier, Scott Turchin, Greg Turgeon
    DATA Bob Zale, Egbert Zijlema
    (With these names, you're SURE to get an A)


    [This message has been edited by G Grant (edited April 22, 2000).]

    Comment

    Working...
    X