I made it so scar gets item prices from the runescape site, it finds the item prices and it always returns like this: 'xxx '
I want scar to automaticly remove the space in 'xxx ' so i can make scar use StrToInt.
Pl0x help.
I made it so scar gets item prices from the runescape site, it finds the item prices and it always returns like this: 'xxx '
I want scar to automaticly remove the space in 'xxx ' so i can make scar use StrToInt.
Pl0x help.
Woot woot.
Replace Str with your string.SCAR Code:Left(Str, Length(Str) - 1)
Or you could
SCAR Code:Trim(Input); //Removes spaces at beginning and end of string
or
SCAR Code:Replace(Input, ' ', ''); //Removes all spaces in string
Interested in C# and Electrical Engineering? This might interest you.
You mean a function like this:
SCAR Code:{*******************************************************************************
Function GetGEPrice(MidMinMax : String; id : Integer): Integer;
By: Floor66
Description: Gets the Mid/Min/Max price out of G.E with the specified item ID
*******************************************************************************}
Function GetGEPrice(MidMinMax : String; id : Integer): Integer;
Var
S, I : String;
Begin
S := GetPage('http://itemdb-rs.runescape.com/viewitem.ws?obj='+ IntToStr(id)); //Get the page
If S = '' Then
Begin
WriteLn('GetGEPrice: Failed to open webpage!');
Exit;
End;
Case MidMinMax Of // Mid, min or max price, take out of the page source
'Mid', 'mid': I := Between('<b>Market price:</b> ', '</span>', S);
'Min', 'min': I := Between('<b>Minimum price:</b> ', '</span>', S);
'Max', 'max': I := Between('<b>Maximum price:</b> ', '</span>', S);
End;
Delete(I, High(I), 1); // Removes the LINE-BREAK that is actually after it:
// <b>Market price:</b> 123 (broken here)
// </span>
I := Replace(I, 'k', '00');
I := Replace(I, 'm', '00000');
I := Replace(I, '.', '');
I := Replace(I, ',', '');
I := Trim(I);
Result := StrToInt(I);
End;
Anyways, I also needed to use Delete(); for 1 extra space.
Ce ne sont que des gueux
There are currently 1 users browsing this thread. (0 members and 1 guests)