In some cases I have used a single field, where ideally I would now like to use two... (e.g rotten tomatoes and metacritic ratings in one string). The values are split with a "/" between them.
I have copied the value I wish to "split" into two custom fields, and have I figured out how to truncate it so it only shows data before the "/" using a script kindly provided by soulsnake here:
viewtopic.php?t=5473&highlight=
Code: Select all
program KeepOnlyFirstValueInFieldCategory;
var
s: string;
i: Integer;
begin
s := GetField(fieldCategory);
i := Pos('/', s);
if i = 0 then
i := Pos(',', s);
if i = 0 then
i := Pos(';', s);
if i > 0 then
begin
s := Copy(s, 1, i-1);
s := Trim(s);
SetField(fieldCategory, s);
end;
end.
Is this possible?[/quote]