Recent

Author Topic: DataPort StopBits and FlowControl to string  (Read 1771 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 572
DataPort StopBits and FlowControl to string
« on: March 13, 2026, 02:07:35 am »
Hi bow i can convert StopBits to string and Flowcontrol to string m they are define on dataport bit i need assign on string to handle  and show to user to select, what i trying is create a form an let to user select the properties of serial port as databits, stopbit, baudrate,flowcontrol i don't some to show dialog form and dataport pleas help me.....

 

cdbc

  • Hero Member
  • *****
  • Posts: 2716
    • http://www.cdbc.dk
Re: DataPort StopBits and FlowControl to string
« Reply #1 on: March 13, 2026, 06:52:16 am »
Hi
Are those enumerated types?
If so, then you can use units: 'typinfo' & 'rtti' to get their names, e.g.:
Code: Pascal  [Select][+][-]
  1. var x: TTypeKind = tkInterfaceRaw; aStr: string;
  2. begin
  3.   aStr:= GetEnumName(typeinfo(X),ord(x));
  4.   showmessage('Typename = '+aStr);
  5. end;
HTH
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

eldonfsr

  • Hero Member
  • *****
  • Posts: 572
Re: DataPort StopBits and FlowControl to string
« Reply #2 on: March 13, 2026, 02:04:37 pm »
Thanks but i don't understand well for example how to define a function to return value..




 


Thaddy

  • Hero Member
  • *****
  • Posts: 18918
  • Glad to be alive.
Re: DataPort StopBits and FlowControl to string
« Reply #3 on: March 13, 2026, 02:14:16 pm »
Since all these are integer type data, simply add sysutils and you can do:
Code: Pascal  [Select][+][-]
  1. StopBit.ToString;
  2. baudrate.ToString;
  3. // etc.....

Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

 

TinyPortal © 2005-2018