Page 1 of 1

Script to clean Actors fields

Posted: 2003-01-28 16:03:40
by Rincevent
Ce script enleve les ',' et ';' entres les noms d'acteurs et les remplace par des retours chariots.


This script replace all ',' and ';' beetwen names by carriage return in all actors fields.


---------------------------------------------
Clean Actors.ifs


Code: Select all

// SCRIPTING
// Find & Repace a value in a field
program FindReplace;
const
  OldValue = ';';
  NewValue = #13+#10;
  Field = fieldActors;
  WholeFieldOnly = False;
begin
  if ((OldValue = '') and (NewValue = '')) or (Field = -1) then
  begin
    ShowMessage('Please modify default values for "OldValue" or "NewValue" and "Field"');
    Error;
  end;
  if WholeFieldOnly then
  begin
    if GetField(Field) = OldValue then
      SetField(Field, NewValue);
  end else
  begin
    if Pos(OldValue, GetField(Field)) > 0 then
      SetField(Field, StringReplace(GetField(Field), OldValue, NewValue));
  end;
end.

Posted: 2003-09-05 07:39:24
by bloody.vc
thx :-) very usefull for me :-)

Posted: 2003-09-06 13:23:33
by Viper
Très bonne idée ça, merci ;)