Question: Define variable cWord as Character no-undo.

cWord = "Web Development Tool".

Needed OUTPUT

Development

How do i get the longest word from this when its a 1 variable only, 

This is a progress4gl code btw

Answer: 
```
DEFINE VARIABLE cWord          AS CHARACTER   NO-UNDO.
DEFINE VARIABLE iWord          AS INTEGER     NO-UNDO.
DEFINE VARIABLE iLongest       AS INTEGER     NO-UNDO.
DEFINE VARIABLE iLength        AS INTEGER     NO-UNDO.
DEFINE VARIABLE iLongestLength AS INTEGER     NO-UNDO.
DEFINE VARIABLE iEntries       AS INTEGER     NO-UNDO.

ASSIGN cWord = "Web Development Tool"

       iEntries = NUM-ENTRIES (cWord, " ").

DO iWord = 1 TO iEntries:

    ASSIGN iLength = LENGTH (ENTRY (iWord, cWord, " ")) . 

    IF iLength > iLongestLength THEN
    DO:
        ASSIGN iLongest       = iWord
               iLongestLength = iLength .        
    END.
END.

MESSAGE ENTRY (iLongest, cWord, " ") 
    VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

```
If you have two words with same length, this will return first.

```
DEF VAR iCount      AS INT  NO-UNDO.
DEF VAR cLongest    AS CHAR NO-UNDO.
DEF VAR cString     AS CHAR NO-UNDO INIT 'Web Development Tool'.

DO  iCount = 1 TO NUM-ENTRIES(cString,' '):
    cLongest = (IF LENGTH(ENTRY(iCount,cString,' ')) > LENGTH(cLongest) THEN ENTRY(iCount,cString,' ') ELSE cLongest).
END.

MESSAGE cLongest
    VIEW-AS ALERT-BOX INFO BUTTONS OK.

```