creating records based on long, delimited variable.

bbweenie

New Member
Hi, all.

I am trying to take a char value such as:

temp1 = "how the west was won".

and, create a new record for each word of the variable temp1.

The only way that I've been able to do this, so far, is to export the variable to a file, then import each value back in again.

This has proven to cause extremely poor performance. Is there a simpler way that I'm missing. It seems to me I should be able to do this using lookup, entry, index, or such within a repeat statement.

Thanks!

Karl.
 

cmorgan

New Member
Originally posted by bbweenie
Hi, all.

I am trying to take a char value such as:

temp1 = "how the west was won".

and, create a new record for each word of the variable temp1.

The only way that I've been able to do this, so far, is to export the variable to a file, then import each value back in again.

This has proven to cause extremely poor performance. Is there a simpler way that I'm missing. It seems to me I should be able to do this using lookup, entry, index, or such within a repeat statement.

Thanks!

Karl.

Try something like this:
Code:
do i = 1 to num-entries( temp1, " " ):

  create tablename.
  assign tablename.fieldname = entry( i, temp1, " " ).

end.  /** i **/
HTH !
 
Top