BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: subinroied ที่ กุมภาพันธ์ 07, 2008, 08:54:36 AM

หัวข้อ: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: subinroied ที่ กุมภาพันธ์ 07, 2008, 08:54:36 AM
hosxp ใช้บน vista ได้ยัง ผมสงสัยว่าใช้งานรัน vista แล้วมีปัญหาหรือเปล่า
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: por ที่ กุมภาพันธ์ 07, 2008, 09:12:56 AM
ได้ครับผม
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: manoi ที่ กุมภาพันธ์ 07, 2008, 11:39:50 AM
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน

ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: naj ที่ กรกฎาคม 17, 2009, 21:37:24 PM
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน

ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
ลองตรวจสอบ ใน HOSxP 3.52.7.17 ยังไม่มีใน Variable ครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: doramon ที่ กรกฎาคม 17, 2009, 22:30:28 PM
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: thannawe ที่ กรกฎาคม 17, 2009, 22:47:28 PM
โอ๊ย   !! มึนทั้ง สองกระทู้  :D ;) :D
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: wiphusit ที่ กรกฎาคม 20, 2009, 09:45:53 AM
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;
ทำไงเหลอครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: bannok ที่ กรกฎาคม 20, 2009, 09:54:33 AM
ใช้ได้ครับ ตอนนี้ก็ใช้อยู่ครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: perjer4675 ที่ กรกฎาคม 20, 2009, 10:36:28 AM
 ;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: thannawe ที่ กรกฎาคม 20, 2009, 10:52:56 AM
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer  :D ;D
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: udomchok ที่ กรกฎาคม 20, 2009, 11:20:22 AM
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer  :D ;D
ก็ทำตามที่ อ.อ๊อด บอกไง
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: thannawe ที่ กรกฎาคม 20, 2009, 11:26:19 AM
copy แล้วเอาไปใส่ ไว้ที่ไหนครับ run ยังไงครับ
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: อู๋kokha50 ที่ กรกฎาคม 20, 2009, 13:17:10 PM
ปัญหาเป็นแบบนี้ ครับ

http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=6479.0

วิธีแก้ เลิกใช้ Vista กลับมาใช้ Xp ที่จุดนัด
หัวข้อ: Re: hosxp ใช้บน vista ได้ยัง
เริ่มหัวข้อโดย: อู๋kokha50 ที่ กรกฎาคม 20, 2009, 13:31:00 PM
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;

อีกวิธีครับ copy ของ อ.ออ๊ด ไปใส่ใน Variable ครับ อ.อ๊อดใช้สูตร คศ+ 543 ครับ ใช้ได้เหมือนกัน