Hi, 

the following lets me chop up a ascii file in bits of 73 characters.

"
PLUGINS rrtftotxt vresult +
  |input_type variable +
  |input_variable vprotocolblob +
  |output_type variable +
  |output_variable vprotocolblobtxt +
  |output_data_type text

  SET VAR vtxtlength INTEGER= (SLEN(.vprotocolblobtxt))
  SET VAR vtxtlength1 TEXT = (CTXT(.vtxtlength))
  SET VAR vaantallijnen REAL = (.vtxtlength/73)
  SET VAR vaantallijnen1 INTEGER = (AINT(.vaantallijnen))
  IF vaantallijnen > vaantallijnen1 THEN
    SET VAR vaantallijnen INTEGER = (.vaantallijnen1 + 1)
  ELSE
    SET VAR vaantallijnen INTEGER = .vaantallijnen1
  ENDIF
  SET VAR vaantallijnen TEXT = (CTXT(.vaantallijnen))
  SET VAR vloop INTEGER = 1
  SET VAR vposition INTEGER = 1

  WHILE vloop <= .vaantallijnen THEN
    SET VAR vprotocolblobtext = (SGET(.vprotocolblobtxt,73,.vposition))
    SET VAR vwrite = (SPUT(.vwrite, .vprotocolblobtext, 1))
    OUTPUT &vqfile APPEND
    WRITE .vwrite
    OUTPUT SCREEN
    SET VAR vwrite = (SFIL((CHAR(32)),128))
    SET VAR vposition = (.vposition + 73)
    SET VAR vloop = (.vloop +1)
  ENDWHILE
"


However I can't prevent the code to chop up even in the middle of a word.

Is there a more elegant way to do things and to preserve the integrity of the 
words, so to chop up before or after a word and not in the middle of word ?

Luc Delcoigne

Reply via email to