 {
[@Help]
|Command list: StdIn "@cmd=arg" or "@cmd arg"
|******************************************************
| @Help          - This help.
|******************************************************
[]
 }

{
Show help in device console and echo to Main console if AllowEcho.
Help text should be placed in program comment is [@Help] section.
First symbol of help block should be | and will be ignored.
}
procedure ShowHelp(AllowEcho:Boolean);
var i,p,sect:Integer; b:Boolean;
begin
 sect:=ReadIniSection(text_New,12,DaqFileRef(ReadIni('ProgramSource'),'.pas'),'[@Help]');
 for i:=0 to text_NumLn(sect)-1 do begin
  if Copy(text_GetLn(sect,i),1,1)='|' then p:=2 else p:=1;
  if AllowEcho then b:=echo(devname+' : '+Copy(text_GetLn(sect,i),p));
  Success(Copy(text_GetLn(sect,i),p));
 end;
 b:=text_Free(sect);
 if AllowEcho then b:=WinSelect(ParamStr('MainConsole'));
end;
