Search This Blog

Showing posts with label microsoft visual foxpro. Show all posts
Showing posts with label microsoft visual foxpro. Show all posts

Change Password Code

Login requirement needs changing password for security reason. Here is a sample change of password for FoxPro.

IF ALLTRIM(THISFORM.Text4.Value) == ALLTRIM(THISFORM.Text4.Value)

REPLACE SviewAccess.Password WITH ALLTRIM(THISFORM.Text4.Value)
*WAIT WINDOW "Password has been changed." NOWAIT
=MESSAGEBOX("Password has been changed. This window will exit.", "Information")
THISFORM.Release()
ELSE
WAIT WINDOW "Confirm password does not match." NOWAIT
ENDIF

General Ledger Balance Sheet



General Ledger Balance Sheet

Table Update Code

Sample of table update implemented in replace:

SELECT SviewAccountList
lBranches = pBranchName
=REQUERY("SviewAccountList")
LOCATE FOR (IdNum) = (THISFORM.Text34.Value)
IF FOUND()
REPLACE TotalDebit WITH THISFORM.TEXT15.Value
REPLACE TotalCredit WITH THISFORM.TEXT18.Value
REPLACE EndingBalance WITH THISFORM.TEXT26.Value
REPLACE Lines WITH "POST"
REPLACE LDate WITH DATE()
=TABLEUPDATE(.T.)
ENDIF

Avoid Backspace on Previous Textbox Code

Have you ever experience that when you press backspace and if the character on current textbox is fully deleted that it goes on previous textbox?

Try to put the following code on keypress of a textbox

IF EMPTY(THIS.SelStart)
IF NKEYCODE=127
KEYBOARD '{DNARROW}'
ENDIF
ENDIF

Retrieve Code


If you want to have an easy way to retrieve data and have it appear in a text box or combo box just by clicking a single data from that row, there is a simple remedy for that. Just follow the following code and paste it on click.

THISFORM.Text1.VALUE = sviewbranch.beginbal
THISFORM.Text2.VALUE = sviewbranch.branchname
THISFORM.Text3.VALUE = sviewbranch.branchaddress
THISFORM.Text4.VALUE = sviewbranch.branchdesc
THISFORM.Text5.VALUE = sviewbranch.debit
THISFORM.Text6.VALUE = sviewbranch.credit
THISFORM.Text7.VALUE = sviewbranch.netchange
THISFORM.Text8.VALUE = sviewbranch.ending
THISFORM.Text9.VALUE = sviewbranch.branchdescnum

FoxPro Window


Above image shows the working interface window of Microsoft Visual FoxPro.

  • Data
  • Documents
  • Class Libraries
  • Code
  • Other

Microsoft Visual FoxPro


Microsoft Visual FoxPro is a data-centric object-oriented and procedural programming language produced by Microsoft. It is derived from FoxPro originally known as FoxBASE which was developed by Fox Software beginning in 1984. Fox Technologies merged with Microsoft in 1992, after which the software acquired further features and the prefix "Visual". The last version of FoxPro 2.6 worked under Mac OS, DOS, Windows, and Unix: Visual FoxPro 3.0, the first "Visual" version, dropped the platform support to only Mac and Windows, and later versions were Windows-only. The current version of Visual FoxPro is COM-based and Microsoft has stated that they do not intend to create a Microsoft .NET version.

FoxPro originated as a member of the class of languages commonly referred to as "xBase" languages, which have syntax based on the dBase programming language. Other members of the xBase language family include Clipper and Recital. A history of the early years of xBase can be found in the dBase entry.
Visual FoxPro, commonly abbreviated as VFP, is tightly integrated with its own relational database engine, which extends FoxPro's xBase capabilities to support SQL query and data manipulation. Unlike most database management systems, Visual FoxPro is a full-featured, dynamic programming language that does not require the use of an additional general-purpose programming environment. It can be used to write not just traditional "fat client" applications, but also middleware and web applications.