Script to clean Actors fields

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Rincevent

Script to clean Actors fields

Post 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.
bloody.vc

Post by bloody.vc »

thx :-) very usefull for me :-)
Viper
Posts: 4
Joined: 2003-09-06 10:13:27

Post by Viper »

Très bonne idée ça, merci ;)
Post Reply