Forum > Packages and Libraries

virtualtree i made some mistake

(1/1)

eldonfsr:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Var tsql:Tsqlquery;    Data: PLRegisterData;    XNode: PVirtualNode;       XNode := VSTPL.AddChild(nil);     if VSTPL.AbsoluteIndex(XNode) > -1 then   begin  // this line error      Data := VSTPL.GetNodeData(Xnode);//      showmessage(inttoSTr(RxMPLNK.FieldByName('RxPLItem').AsInteger));      Data^.RxPLItem := '';      Data^.RxPlQty  := RxMPLNK.FieldByName('RxPlQty').AsInteger;      Data^.RxPlpnPartNumber := RxMPLNK.FieldByName('RxPnpartnumber').AsString;      Data^.RxCurrentCost := 0.00;      Data^.RxDetail := '';      Data^.RxTitle := '';      Data^.RxPlType := '';      end;                              
how to change that property or what is me mistake.

thanks

GetMem:
Hi eldonfsr,


--- Quote ---Warning: Comparison might be always true due to range of constant and expression
--- End quote ---
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:
Ok Thanks

Navigation

[0] Message Index

Go to full version