Problem z floating point w google search

0

siemka:)
mam dosc dziwny problem, załączylem do swojej aplikacji (jest to usluga systemowa) funkcje wyszukiwania w google ( google webservice ).
Pojawil sie dosc dziwny problem,a mianowicie co rusz pojawia sie blad " is not a valid floating point value" przy zwrocie danych z google.
Znajomy doradzil bym ustawil DecimalDelimiter="." co rozwiazalo problem w kodzie z tutoriala, jednak w mojej aplikacji nadal sie pojawia ten sam blad -mimo zmiany decimal delimitera.
Szczerze to nie mam pojęcie gdzie szukac przyczyny.
Moglby ktos pomoc? czy to moze jakis blad delphi 6 update 2?

zalaczam prosty kod :

procedure 1.PytajGoogle(Pytanie:String);
var
   Results: GoogleSearchResult;
   i: Integer;
begin
try

  Results := GetGoogleSearchPort.doGoogleSearch('1WpiIaxr+k+hbyYbRLZOJfg7X9NgI837',
    'cos do szukania, 0, 10, True, '', True, 'lang_pl', 'UTF-8', 'UTF-8');
  for i:=Low(Results.resultElements) to High(Results.resultElements) do
    begin
      Log(IntToStr(Succ(i))+ Results.resultElements[i].title+ Results.resultElements[i].URL+Results.resultElements[i].cachedSize);
    end
  except
  on E : Exception do
  begin
  LogError('Bląd Google : ' + E.Message);
  end;
  end;
end;

Ustawilem DecimalDelimiter na kropke, DecimalSeparator na kropke,nadal ten sam blad z floating point.

0

co to jest GoogleSearchResult

0

to jest to co zwraca webserwice google search

http://code.google.com/apis/soapsearch/api_faq.html

a bezposredni wsdl to :

http://api.google.com/GoogleSearch.wsdl

Nie rozumiem czemu konkretnie w tym programie wystapuje ten foating point jak o ie wiem zrobilem wszystko jak w przykladowym kodzie google

0
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://api.google.com/GoogleSearch.wsdl
// Codegen  : [wfDebug,wfVerbose,wfSkipHttpBindings,wfSkipUnusedTypes]
// Version  : 1.0
// (2006-11-18 15:24:35 - $Revision:   1.9.1.0.1.0.1.9  $)
// ************************************************************************ //

unit GoogleSearch;

interface

uses InvokeRegistry, Types, XSBuiltIns;

type

  DirectoryCategory    = class;               
  ResultElement        = class;               
  GoogleSearchResult   = class;               

  // ************************************************************************ //
  // Namespace : urn:GoogleSearch
  // ************************************************************************ //
  DirectoryCategory = class(TRemotable)
  private
    FfullViewableName: String;
    FspecialEncoding: String;
  published
    property fullViewableName: String read FfullViewableName write FfullViewableName;
    property specialEncoding: String read FspecialEncoding write FspecialEncoding;
  end;

  // ************************************************************************ //
  // Namespace : urn:GoogleSearch
  // ************************************************************************ //
  ResultElement = class(TRemotable)
  private
    Fsummary: String;
    FURL: String;
    Fsnippet: String;
    Ftitle: String;
    FcachedSize: String;
    FrelatedInformationPresent: Boolean;
    FhostName: String;
    FdirectoryCategory: DirectoryCategory;
    FdirectoryTitle: String;
  public
    destructor Destroy; override;
  published
    property summary: String read Fsummary write Fsummary;
    property URL: String read FURL write FURL;
    property snippet: String read Fsnippet write Fsnippet;
    property title: String read Ftitle write Ftitle;
    property cachedSize: String read FcachedSize write FcachedSize;
    property relatedInformationPresent: Boolean read FrelatedInformationPresent write FrelatedInformationPresent;
    property hostName: String read FhostName write FhostName;
    property directoryCategory: DirectoryCategory read FdirectoryCategory write FdirectoryCategory;
    property directoryTitle: String read FdirectoryTitle write FdirectoryTitle;
  end;

  ResultElementArray = array of ResultElement; 
  DirectoryCategoryArray = array of DirectoryCategory; 

  // ************************************************************************ //
  // Namespace : urn:GoogleSearch
  // ************************************************************************ //
  GoogleSearchResult = class(TRemotable)
  private
    FdocumentFiltering: Boolean;
    FsearchComments: String;
    FestimatedTotalResultsCount: Integer;
    FestimateIsExact: Boolean;
    FresultElements: ResultElementArray;
    FsearchQuery: String;
    FstartIndex: Integer;
    FendIndex: Integer;
    FsearchTips: String;
    FdirectoryCategories: DirectoryCategoryArray;
    FsearchTime: Double;
  public
    destructor Destroy; override;
  published
    property documentFiltering: Boolean read FdocumentFiltering write FdocumentFiltering;
    property searchComments: String read FsearchComments write FsearchComments;
    property estimatedTotalResultsCount: Integer read FestimatedTotalResultsCount write FestimatedTotalResultsCount;
    property estimateIsExact: Boolean read FestimateIsExact write FestimateIsExact;
    property resultElements: ResultElementArray read FresultElements write FresultElements;
    property searchQuery: String read FsearchQuery write FsearchQuery;
    property startIndex: Integer read FstartIndex write FstartIndex;
    property endIndex: Integer read FendIndex write FendIndex;
    property searchTips: String read FsearchTips write FsearchTips;
    property directoryCategories: DirectoryCategoryArray read FdirectoryCategories write FdirectoryCategories;
    property searchTime: Double read FsearchTime write FsearchTime;
  end;

  // ************************************************************************ //
  // Namespace : urn:GoogleSearch
  // soapAction: urn:GoogleSearchAction
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : rpc
  // binding   : GoogleSearchBinding
  // service   : GoogleSearchService
  // port      : GoogleSearchPort
  // URL       : http://api.google.com/search/beta2
  // ************************************************************************ //
  GoogleSearchPort = interface(IInvokable)
  ['{0B396A82-A4DD-69A7-A771-6D80F8831A71}']
    function  doGetCachedPage(const key: String; const url: String): TByteDynArray; stdcall;
    function  doSpellingSuggestion(const key: String; const phrase: String): String; stdcall;
    function  doGoogleSearch(const key: String; const q: String; const start: Integer; const maxResults: Integer; const filter: Boolean; const restrict: String; const safeSearch: Boolean; const lr: String; const ie: String; const oe: String): GoogleSearchResult; stdcall;
  end;

function GetGoogleSearchPort(UseWSDL: Boolean=System.False; Addr: string=''): GoogleSearchPort;

implementation
  uses SOAPHTTPClient;

function GetGoogleSearchPort(UseWSDL: Boolean; Addr: string): GoogleSearchPort;
const
  defWSDL = 'http://api.google.com/GoogleSearch.wsdl';
  defURL  = 'http://api.google.com/search/beta2';
  defSvc  = 'GoogleSearchService';
  defPrt  = 'GoogleSearchPort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  RIO := THTTPRIO.Create(nil);
  try
     if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
    Result := (RIO as GoogleSearchPort);
  finally
    if Result = nil then
      RIO.Free;
  end;
end;

destructor ResultElement.Destroy;
begin
  if Assigned(FdirectoryCategory) then
    FdirectoryCategory.Free;
  inherited Destroy;
end;

destructor GoogleSearchResult.Destroy;
var
  I: Integer;
begin
  for I := 0 to Length(FresultElements)-1 do
    if Assigned(FresultElements[I]) then
      FresultElements[I].Free;
  SetLength(FresultElements, 0);
  for I := 0 to Length(FdirectoryCategories)-1 do
    if Assigned(FdirectoryCategories[I]) then
      FdirectoryCategories[I].Free;
  SetLength(FdirectoryCategories, 0);
  inherited Destroy;
end;

initialization
  InvRegistry.RegisterInterface(TypeInfo(GoogleSearchPort), 'urn:GoogleSearch', '');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(GoogleSearchPort), 'urn:GoogleSearchAction');
  RemClassRegistry.RegisterXSClass(DirectoryCategory, 'urn:GoogleSearch', 'DirectoryCategory');
  RemClassRegistry.RegisterXSClass(ResultElement, 'urn:GoogleSearch', 'ResultElement');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ResultElementArray), 'urn:GoogleSearch', 'ResultElementArray');
  RemClassRegistry.RegisterXSInfo(TypeInfo(DirectoryCategoryArray), 'urn:GoogleSearch', 'DirectoryCategoryArray');
  RemClassRegistry.RegisterXSClass(GoogleSearchResult, 'urn:GoogleSearch', 'GoogleSearchResult');

end. 
0

nie widzę w tym kodzie nic, co by miało za zadanie zamienić cokolwiek na float'a. A w której linijce masz ten błąd?

0

to nie jest blad powstajacy przy kompilacji czy build aplikacji!
jest to wyjatek ktory zapisuje w pliku poprzez funkcje LogError (funkcja widoczna w kodzie przeciez): o to wyjatki:

Bląd Google : '0.020686' is not a valid floating point value
Bląd Google : '0.02338' is not a valid floating point value
Bląd Google : '0.019527' is not a valid floating point value
Bląd Google : '0.029468' is not a valid floating point value
Bląd Google : '0.024345' is not a valid floating point value
Bląd Google : '0.017814' is not a valid floating point value

Wiem, tzn domyslam ze iz jest to wynik konwersji danych w jezyku angieskim na polski ( roznica w decimaldelimiter i decimalseparator w opu jezykach),jednak nie mam pojecia czemu w jednym projekcie o tym samym dzialajcym kodzie co drugi projekt to dziala a w drugim nie.
Moze ejst jakies ustawienie projektu,opcje projektu ktore sa za to odpowiedzialne,jak na razie odkryem tyko
user overides i dodalem tam te poprawki, jednak to tylko dziala w jednym projekcie drugi caly czas wywala blad.

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0