Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "C:Program Files (x86)PostgreSQL9.0binpsql.exe" -h localhost -p 5432 -d myDB -U myadmin -f "C:UsersuserAppDataRoamingff.sql"
- function GetNextHex(InStr:String;var Position:Integer):String;
- var
- NextHex: Integer;
- begin
- NextHex := PosEx('%', InStr, Position);
- if (NextHex > -1) then
- Result := Copy(InStr, NextHex, 3)
- else
- Result := '';
- Position := NextHex;
- end;
- function PercentHexToInt(Hex: String):Integer;
- var
- str : string;
- begin
- if (Hex[1] <> '%') then Result := 0
- else
- begin
- // Result := strtoint(StrToHex('$' + Copy(Hex, 1,2)));
- str :=StringReplace(HEx,'%','',[rfReplaceAll,rfIgnoreCase]);
- str:=trim(str);
- Result := StrToInt(('$' +str));
- end;
- end;
- function ReplaceHexValues(Str: String):String;
- var
- Position:Integer;
- HexValue:String;
- IntValue:Integer;
- CharValue:String;
- begin
- Position := 0;
- while(Position > -1)
- begin
- HexValue := GetNextHex(Str, Position);
- IntValue := PercentHexToInt(HexValue);
- CharValue := Char(IntValue);
- if (CharValue = #0) then break;
- //Note that Position Currently contains the the start of the hex value in the string
- Delete(Str, Position, 3);
- Insert(CharValue,Str,Position);
- end;
- Result:=Str;
- end;
Add Comment
Please, Sign In to add comment