Xbasic

WORD_MOVE Function

Syntax

New_List as C = word_move(C cString ,N nFrom ,N nTo [,C cDelimiter ])

Arguments

cString

A CR-LF delimited list of words or entries.

nFrom

The position of the word or entry to move. Numeric

nTo

The new position of the word or entry. Numeric

cDelimiter

Character

Returns

New_ListCharacter

The modified list.

Description

Moves a word in a list to the specified location.

Discussion

The WORD_MOVE() function moves a word or entry from one position to another in a CR-LF delimited list.

Example

dim s as C
s = <<%a%
bird
cow
chicken
goat
%a%
? word_move(s, 2, 4)
= bird
chicken
goat
cow

See Also