setting a standard value

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
jan_hut

setting a standard value

Post by jan_hut »

I would like change my script so it imports user rating ALWAYS as 0
This is waht it looks like now:
// Rating
LineNr := FindLine('User Rating:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr + 4);
if Pos('/10', Line) > 0 then
begin
BeginPos := pos('<b>', Line) + 3;
Value := IntToStr(Round(StrToInt(StrGet(Line, BeginPos), 0) + (StrToInt(StrGet(Line, BeginPos + 2), 0) / 10)));
SetField(fieldRating, Value);
end;
end;
I have tried to set Value to as Value := 0 (as well as "0") and played around with fieldRating to no avail.
Any hint on how to do this?
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Actually it is '0' that you should use :D (in Pascal strings are delimited by ' ')
So simply replace the above code by this :
SetField(fieldRating, '0');

You can also remove this code block to not import rating.
jan_hut

Post by jan_hut »

AAAAH I can hit myself in the head....of course.
How stupid of me.

Thanks!
Post Reply