BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: subinroied ที่ กุมภาพันธ์ 07, 2008, 08:54:36 AM
-
hosxp ใช้บน vista ได้ยัง ผมสงสัยว่าใช้งานรัน vista แล้วมีปัญหาหรือเปล่า
-
ได้ครับผม
-
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน
ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
-
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน
ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
ลองตรวจสอบ ใน HOSxP 3.52.7.17 ยังไม่มีใน Variable ครับ
-
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;
-
โอ๊ย !! มึนทั้ง สองกระทู้ :D ;) :D
-
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;
ทำไงเหลอครับ
-
ใช้ได้ครับ ตอนนี้ก็ใช้อยู่ครับ
-
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
-
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer :D ;D
-
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer :D ;D
ก็ทำตามที่ อ.อ๊อด บอกไง
-
copy แล้วเอาไปใส่ ไว้ที่ไหนครับ run ยังไงครับ
-
ปัญหาเป็นแบบนี้ ครับ
http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=6479.0
วิธีแก้ เลิกใช้ Vista กลับมาใช้ Xp ที่จุดนัด
-
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 ครับ ใช้ได้เหมือนกัน