Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/06/22 in all areas

  1. PeterBelow

    comma separated values in DBEdit

    Not with a TDBEdit. Databound controls are typically linked to one single record (the current record in the dataset); using them the typical workflow is: add new record - enter data for this record - post the record to the dataset. You have to use an unbound TEdit in your case and dissect its content in code, e.g. when the user leaves the control (OnExit event), or when he pushes a button. Pseudo code: var LList: TStringlist; N, LValue: integer; begin LList := TStringlist.Create; try LList.StrictDelimiter := True; LList.Commatext := Edit1.Text; for N:= 0 to LLIst.Count - 1 do begin if TryStrToInt(Trim(LList[N]), LValue) then begin add record to dataset store LValue into the dataset field post the record end; {if} end; {for} finally LList.Free; end; end;
  2. Serge_G

    Function with 2 return values ?

    Hi, only a single result but you can change to function GetBomCosts(const ItemCode : String; var value1, value2 : Double) : boolean begin with TFDQuery.Create do begin Value1:=0; value2:=0; Connection:= FDConnection1; SQL.Text:='SELECT itemcode,value1,value2 from table where code='+quotedstr(itemcode); active:=true; if fieldbyname('Itemcode').isNull then result:=false else begin value1:=FieldByName('value1').asFloat; value2:=FieldByName('value2').asFloat; result:=true; end; active:=false; end; end;
  3. Vandrovnik

    comma separated values in DBEdit

    I would use plain tEdit.
  4. Stefan Glienke

    Compiling a component for Win64

    It was a must if you have done a bit more than just registering a component (such as custom designers and stuff) because then the package requires designide.bpl which you must not ship. Yet the IDE even in 11.1 creates new packages as design&runtime 🙄
×