๙/๒/๕๒

Sub Field 2.0






Sub Field 2.0

แนวคิดของ sub field คือ การแปลงการป้อนข้อความ (string) แบบอิสระ
ให้กลายเป็นการป้อนข้อความแบบมี format แน่นอน
โดยแบ่งส่วนของข้อความให้กลายเป็นเสมือนการป้อนข้อมูลในฟอร์มที่มี field รับข้อมูลอยู่

ประโยชน์ของ sub field คือ ช่วยจัดระบบของการตั้งชื่อ เช่น สินค้า หรือ ลูกค้า
ให้อยู่ในรูปแบบ ที่สามารถนำข้อมูลไปจัดเรียง หรือประมวลผลต่อได้ง่าย
ลดปัญหาความผิดพลาดในการพิมพ์ข้อความ
หรือแม้กระทั่งการเคาะวรรค เพื่อเว้นวรรค
ซึ่งในแง่ข้อมูล ระหว่างเคาะวรรค 1 space กับ 2 spaces ก็มีความหมายต่างกัน

แนวคิด sub field นั้่น เดิมได้มาจาก adm
เพื่อแก้ปัญหา ความยุ่งยากในการตั้งชื่อสินค้า ของธุรกิจ โรงงานกระดาษ

เราสามารถใช้ความสามารถของ sub field ในทุกๆ ที่
ที่เป็นการป้อนข้อมูลแบบข้อความ เช่น กระดาษลูกฟูก ลอน?S; ?N;X?N;
โปรแกรมจะตรวจสอบข้อความที่ป้อน เมื่อกด Enter
หากพบสัญญลักษณ์ ? และ ; อยู่ตามเงื่อนไขของ sub field notation
โปรแกรมก็จะเปิดกล่องย่อย เพื่อเข้าสู่การป้อนข้อมูลแบบ sub field

1. simple sub field

เป็นการกำหนด sub field แบบง่ายๆ โดยใช้ default sub field properties ตามที่โปรแกรมกำหนด

?S; รับข้อมูล string
?D; รับข้อมูล date
?T; รับข้อมูล time
?N;
รับข้อมูล string แบบ number (เวลาป้อนตัวเลขจะชิดซ้าย) ใช้กับ เลขที่มิเตอร์, เลขที่บิล เป็นต้น
?M; รับข้อมูล money ทศนิยม 2 ตำแหน่ง
?I; รับข้อมูล integer ไม่มีทศนิยม (เวลาป้อนตัวเลขจะชิดขวา) ใช้คำค่าที่เป็นตัวเลข เช่น จำนวนวัน อายุ
?Q; รับข้อมูลตัวเลข จำนวน (Quantity) จำนวนทศนิยม ตามข้อกำหนด default ทศนิยมของจำนวนสินค้า


2. advance sub field

2.1 custom size
เราอาจกำหนดขนาดของ sub field โดยใช้ : ตามหลังรหัส type ของ sub field ได้ดังนี้
?S:10; รับข้อมูล string ขนาด 10 ตัวอักษร
?N:3; รับข้อมูล string ที่เป็นตัวเลข ไม่เกิน 3 ตัวอักษร
?M:8; รับข้อมูลตัวเลขจำนวนเงิน ขนาดไม่เกิน 8 ตัว

2.2 custom picture

เราสามารถกำหนด sub field ให้มีขนาดกว้าง หรือรูปแบบการรัีบข้อมูลที่ป้อนตามต้องการ
โดยกำหนด picture ของ sub field
โดยใช้ , ต่อท้าย ภายใน sub field เช่น
?S,#X-8; รับข้อมูล string ขนา่ด 8 ตัวอักษร

?S,#9-4; รับข้อมูล string เฉพาะตัวเลข ขนาด 4 ตัวอักษร มีผลเหมือนกับการใช้ ?N:4;

?M,#M-8; รับข้อมูลตัวเลขจำนวนเงิน ขนาดไม่เกิน 8 ตัว หรือ 9,999.99


สำหรับ การกำหนด picture ที่โปรแกรมรองรับมีดังนี้
#x สำหรับใช้กับ string ตัวอักษรใดๆ รับภาษาอังกฤษทั้งตัวเล็ก และตัวใหญ่
#X สำหรับใช้กับ string แปลงตัวอักษรภาษาอังกฤษเป็นตัวใหญ่อัตโนมัติ
#0 ตัวเลข ไม่มีทศนิยม กรณีที่ไม่เต็ม จะใส่ 0 นำหน้าให้ เช่น  000012
#9 ตัวเลข ไม่มีทศนิยม
#M ตัวเลขจำนวนเงิน (Money) ทศนิยม 2 ตำแหน่ง
#B ตัวเลขจำนวนเงิน (Baht) ทศนิยม 2 ตำแหน่ง แต่ถ้าไม่มีเศษสตางค์ จะแสดงเป็น .- เช่น 300.-
#( ตัวเลขจำนวนเงิน ทศนิยม 2 ตำแหน่ง ถ้าเป็นลบ จะแสดงเป็นวงเล็บ เช่น (300.00)
#Q ตัวเลขจำนวน ทศนิยม 3 ตำแหน่ง


2.3 custom name
เราสามารถตั้งชื่อ sub field เพื่อให้ผู้ป้อนข้อมูล เข้าใจความหมายของ sub field ดียิ่งขึ้น
เช่น กระดาษลูกฟูก ลอน?S; ?กว้าง:N;X?ยาว:N;
จะเห็นว่า จากเดิมเราใช้ ?N; เราเปลี่ยนเป็น ?กว้าง:N; และ ?ยาว:N; แทน
ถ้าเราตั้งชื่อโดยไม่กำหนด type ให้ sub field โปรแกรมจะถือว่า sub field นั้นเป็นชนิด string อัตโนมัติ
เช่น ?ลอน; เราไม่จำเป็นต้องใช้ ?ลอน:S;
นอกจากนี้ เรายังสามารถกำหนด custom size หรือ custom picture ได้อีกด้วย
เช่น ?กว้่าง,#9-4; หรือ ?กว้าง:N4;

แต่ข้อจำกัดของการใช้วิธีตั้งชื่อก็คือ บางครั้ง field ข้อความที่เราใช้กำหนดต้นแบบ
ก็อาจมีความยาวไม่พอที่จะตั้งค่า sub field แบบ custom name


๒๑/๓/๕๑

PHP + .NET Phalanger for Visual Studio 2008 Downloads

Phalanger for Visual Studio 2008 Downloads

If you don’t have any version of Visual Studio, you’ll need to install Visual Studio 2008 Shell [1] first. Make sure that you’re installing the “integrated mode”, which allows installation of new programming languages (like Phalanger). After installing Phalanger you may optionally install Silverlight 1.1 Tools [2]. It will allow debugging of Silverlight PHP applications, but it is not needed if you don’t need debugging you’ll still be able to develop and run Silverlight apps. Also note that this is an alpha version, so it may cause some issues. In my case, it worked very well and debugging is quite useful! After installing these two pre-requisites, you can install Phalanger [3] (note that you need the most recent version, to be able to use Visual Studio 2008 Integration), and finally you can install Visual Studio Integration package
[1] Microsoft Visual Studio 2008 Shell (integrated mode) Redistributable Package - Microsoft Download Center
[2] Microsoft Silverlight 1.1 Tools Alpha for Visual Studio 2008 - Microsoft Download Center
[3] Phalanger 2.0, March 2008 (phalanger-2.0-march-2008.zip)
[4] Visual Studio 2008 Integration, March 2008(vsintegration-2.0-march-2008.zip)

๒๐/๓/๕๑

Windows Live FolderShare

Windows Live FolderShare beta

Ever realized you needed a document that was on a different computer from the one you were on? With FolderShare, you can access your files from anywhere.



Keep all your files in sync
Use FolderShare to create a mirrored image of your most important folders - like your Favorites, Pictures, and Documents - so they're the same on all your computers.

Sharing files is easier than ever
Sharing with friends, co-workers, and family is easy when you add and update files in a shared library. Large files? Not a problem - FolderShare can sync files up to 2 GBs in size. And it works on both Mac and PC.

Get to your files instantly when you're away from home
Install FolderShare on all your computers, and you can access all your files from any computer on the Internet.

File sync feature can implement remote printing solution for distribute print-to-file from DOS application.

Google