อีเวนต์ (Events)
เกริ่นนำ…ในการเขียนโปรแกรมเชิงวัตถุ(Object Oriented Program) สิ่งที่จำเป็นอย่างยิ่งที่จะต้องรู้ก็คือการทำงานของ event ต่างๆที่เกิดขึ้นกับ object นั้นๆ ยิ่งถ้าท่านเคยทำการเขียนโปรแกรมแบบโครงสร้างมาก่อนแล้ว พอมาเจอกับ event งงเป็นไก่ตาแตก บางท่านถึงกับเลิกที่จะเรียนรู้ไปเลย ผมก็เป็นคนหนึ่งในจำนวนนั้นเหมือนกัน แต่ชีวิตนี้ยังมีหวังเลยไปรายการฝันที่เป็นจริง คุณไตรภพให้รถเข็นขายก๋วยเตี๋ยวมาคันหนึ่ง ก็เลยคิดได้ตั้งหน้าตั้งตากลับมาศึกษาใหม่หมด เลยได้สัจจะธรรมของเหตุการณ์(event) ต่างๆใน Visual FoxPro ว่าระหว่างที่เราทำงานกับวัตถุหนึ่งๆมันเกิดเหตุการณ์ขึ้นมากับ วัตถุนั้นหลายอย่างด้วยกัน แต่พอเกิดแล้วเราไม่รู้สึกว่ามันเกิดอะไรขึ้นหรอกเพราะเนื่องจากเรายังไม่ได้ทำการนำมันไปใช้งาน แต่ก่อนที่คุณจะนำมันไปใช้งานนั้นคุณต้องทำความเข้าใจกับลำดับการทำงานของ event ต่างๆกันก่อนว่าไก่กับไข่อะไรเกิดก่อน

Read More

1 $ การค้นหานิพจน์อักขระ
2 % ส่งค่าเศษที่ได้จากการหาร
3 & การทำงานแบบแมโคร
4 ABS() ส่งค่าสัมบูรณ์ของตัวเลข
5 ACOPY() การคัดลอกอาร์เรย์
6 ACOS() สั่งค่า arc cosine
7 ADELการลบสมาชิกในอาร์เรย์
8 ADIR() การแสดงข่าวสารของไดเรกทอรีนั้นๆ
9 AELEMENT() การส่งค่าตำแหน่งที่อยู่ในอาร์เรย์
10 AFIELDS() นำข่าวสารของ field มาไว้ในอาร์เรย์

Read More

ทดสอบแล้วใช้ได้ แต่ใช้จริงต้องปรับตำแหน่งเรียก mysqldump ที่ต่างกัน
OS : Windows Server

เช่นถ้าใช้ wamp เป็นตัวติดตั้งก็จะอยู่ที่
C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump

ถ้าติดตั้ง MySQL เพียวๆ ก็คงต้องหาตำแหน่งที่ถูกต้องของเซิร์ฟเวอร์แต่ละเวอร์ชั่น

เช่น C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump

การจะกำหนดเวลาแบ็กอัพนั้น Schedule ของ Windows Server ให้เรียกไฟล์ xxxxx.bat เพื่อทำงานตามเวลาที่กำหนด (หากใช้ลีนุกซ์ก็คงจะใช้ cronjob และจะสะดวกกว่าหากจัดการด้วย webmin)

Read More

VFP has two realms that concern datatypes: the DBF table, and the types of variables and .value property. There are 3 differences: objects, numerics, and chars. There is no Object type of DBF field, and DBF has different kinds of numerics: integer, float, currency, etc. as where numeric variables are all stored in floating point. VFP automagically converts back and forth when it moves data between memory and disk. As far as I know this should not concern anyone – it has been this way for years, and no one has ever suggested that there are any pitfalls to be aware of.

 Moving memos to memory does the same thing, it ends up as a character variable type. — Mike Helland

Ok, I got bit: Currency’s don’t play nice with Pad L() – you have to use MtoN(). Thanks Bill

Read More

The VFP function that commits changes made to a view or buffered table to the underlying data store.


The syntax is;

TableUpdate(nRecords, lForce, cAlias, ArrayName)

nRecords is a number (0, 1, or 2) where:

0 updates only the current record

1 updates all records but stops on the first record that fails

2 update all records and will continue to update additional records after a record fails to update

(this first argument still supports the older syntax of a logical where .T. is identical to 1 and .F. the same as 0)

Read More

Article: Q130462
Product(s): Microsoft FoxPro
Version(s): WINDOWS:3.0,5.0,6.0
Operating System(s):
Keyword(s): kbvfp300 kbvfp500 kbvfp600
Last Modified: 19-OCT-2000

——————————————————————————-
The information in this article applies to:

– Microsoft Visual FoxPro for Windows, versions 3.0, 5.0, 6.0
——————————————————————————-

SUMMARY
=======

This article lists the differences in functionality between two new functions –
REQUERY() and REFRESH() – in Visual FoxPro.

MORE INFORMATION
================

Read More

ความสามารถที่ยอดเยี่ยมและทรงพลังใน MySQL และฐานข้อมูลอื่น ๆ คือความสามารถในการรวมไวยากรณ์นิพจน์ปกติเมื่อเลือกข้อมูล การสนับสนุน expresion ปกติใน MySQL นั้นกว้างขวาง สูตรนี้ตรวจสอบการใช้งานนิพจน์ปกติใน MySQL และแสดงรายการเมตาอักขระปกติที่รองรับ

ไวยากรณ์พื้นฐานที่ใช้นิพจน์ทั่วไปในแบบสอบถาม MySQL คือ:

SELECT something FROM table WHERE column REGEXP "regexp"

Read More

Alternatively if you want to pursue the Excel route manually then …

If you have a table MYTABLE.DBF with the following structure:

Structure for table:          C:\TEMP\MYTABLE.DBF
Number of data records:       0       
Date of last update:          01/05/2014
Code Page:                    1252    
 Field  Field Name            Type                        Width      Dec    Index   Collate     Nulls       Next       Step
     1  FIRSTNAME             Character                      20                                    No
     2  LASTNAME              Character                      20                                    No
     3  AGE                   Numeric                         3                                    No
     4  ID                    Integer (AutoInc)               4               Asc   Machine        No          1          1
** Total **                                                  48

Then you can dump the structure to another DBF via the VFP Command Window like this:

Read More

RS485 (ย่อมาจาก: Recommended Standard no. 485) คือมาตรฐานการสื่อสารข้อมูลดิจิตอลแบบอนุกรม (serial communication) ซึ่งถูกกำหนดขึ้นครั้งแรกในปี ค.ศ. 1998 โดยความร่วมมือของ TIA (Telecommunications Industry Association) และ EIA (Electronic Industries Association) มาตรฐาน RS485 ถูกใช้อย่างแพร่หลายในโรงงานอุตสาหกรรม เนื่องจากสามารถส่งสัญญาณได้ไกลและยังสามารถส่งพร้อมๆกันได้หลายจุด

Read More