Recent

Author Topic: virtualtree i made some mistake  (Read 2245 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
virtualtree i made some mistake
« on: August 11, 2021, 03:59:02 pm »
Hello I trying  to  implement virtualtree on my app i follow the wiki and make test app running wood but at my app send me this error i don't know what was my mistake.
fassypart.pas(140,36) Warning: Comparison might be always true due to range of constant and expression
Code: Pascal  [Select][+][-]
  1. Var tsql:Tsqlquery;
  2.     Data: PLRegisterData;
  3.     XNode: PVirtualNode;  
  4.  
  5.     XNode := VSTPL.AddChild(nil);
  6.      if VSTPL.AbsoluteIndex(XNode) > -1 then   begin  // this line error
  7.       Data := VSTPL.GetNodeData(Xnode);
  8. //      showmessage(inttoSTr(RxMPLNK.FieldByName('RxPLItem').AsInteger));
  9.       Data^.RxPLItem := '';
  10.       Data^.RxPlQty  := RxMPLNK.FieldByName('RxPlQty').AsInteger;
  11.       Data^.RxPlpnPartNumber := RxMPLNK.FieldByName('RxPnpartnumber').AsString;
  12.       Data^.RxCurrentCost := 0.00;
  13.       Data^.RxDetail := '';
  14.       Data^.RxTitle := '';
  15.       Data^.RxPlType := '';
  16.  
  17.  
  18.     end;                            
  19.  

how to change that property or what is me mistake.

thanks

balazsszekely

  • Guest
Re: virtualtree i made some mistake
« Reply #1 on: August 11, 2021, 04:19:12 pm »
Hi eldonfsr,

Quote
Warning: Comparison might be always true due to range of constant and expression
The result of the function VSTPL.AbsoluteIndex is a cardinal(longword), so the range is between 0..4294967295. Makes no sense to compare with -1.

eldonfsr

  • Sr. Member
  • ****
  • Posts: 446
Re: virtualtree i made some mistake
« Reply #2 on: August 18, 2021, 01:48:29 am »
Ok Thanks

 

TinyPortal © 2005-2018