Posts

Showing posts from January, 2008

(VFP) - How To Calling Store Procedure From VFP

USING SQL SERVER: ======================= MYSTS = "EXECUTE MYQUE" SQLEXEC(1, MYSTS, "MYCURSOR") USING MYSQL: ================= MYSTS = "CALL MYQUE();" SQLEXEC(1, MYSTS, "MYCURSOR")

(VFP) - Include Beautiful Clock on your Form

PUBLIC omform1 SET CLASSLIB TO c:\VCLOCK\class\mform.vcx ADDITIVE SET CLASSLIB TO c:\VCLOCK\klock.vcx ADDITIVE omform1=NEWOBJECT("mform1") omform1.Show RETURN ******************************************************** *-- Author: Leosan *-- Form: mform1 (c:\VCLOCK\form\clock.scx) *-- ParentClass: mform (c:\VCLOCK\class\mform.vcx) *-- BaseClass: form *-- Time Stamp: 01/30/08 10:16:06 AM * DEFINE CLASS mform1 AS mform Height = 177 Width = 181 ShowWindow = 0 DoCreate = .T. Caption = "Clock" MaxButton = .F. MinButton = .F. Name = "Mform1" ADD OBJECT clock1 AS clock WITH ; Top = 5, ; Left = 9, ; Width = 168, ; Height = 168, ; ZOrderSet = 1, ; Name = "Clock1", ; year.Name = "year", ; Transring1.Height = 160, ; Transring1.Width = 160, ; Transring1.Name = "Transring1", ; Timer1.Name = "Timer1", ; dayname.Name = "dayname", ; month.Name = "month", ; day

(VFP) - How to Get Week on Current Month

***************************************************** ** Show you how to Get Week count on Current Month ** ***************************************************** INT((DAY(GOMONTH(DATE(),1)-DAY(GOMONTH(DATE(),0))))/7)

(VFP) - Display Fade in Form How to Do it ?

****************************************** ** Examples How to Display Fade In Form ** ****************************************** _screen.WindowState = 2 LOCAL frmFadeIn as Form frmFadeIn = CREATEOBJECT("myFadeInForm") frmFadeIn.Show READ EVENTS DEFINE CLASS myFadeInForm as Form AutoCenter = .T. Caption = "Fade-In Form" ShowWindow = 2 nDepth = 0 ADD OBJECT fadeTime as timer WITH ; interval = 10,; enabled = .T. PROCEDURE Init DECLARE INTEGER SetWindowLong IN user32.DLL INTEGER hWnd, ; INTEGER nIndex, ; INTEGER dwNewLong DECLARE INTEGER SetLayeredWindowAttributes IN WIN32API INTEGER HWND, ; INTEGER crKey, ; INTEGER bAlpha,; INTEGER dwFlags #DEFINE LWA_TRANSPARENT 1 #DEFINE LWA_ALPHA 2 #DEFINE GWL_EXSTYLE -20 #DEFINE WS_EX_LAYERED 0x00080000 SetWindowLong(thisform.HWND, GWL_EXSTYLE, WS_EX_LAYERED) SetLayeredWindowAttributes(thisform.HWND, 0, thisform.nDepth, LWA_ALPHA) ENDPROC PROCEDURE unload CLEAR DLLS CLOSE ALL RELEASE ALL QUIT ENDPROC PROCEDURE fadeTime.timer IF thi

(VFP) - How To Run Exe File and include them to your Project

******************************* ** Author : Leosan ** ** Date Publish : 29/01/2005 ** ******************************* * Examples how to run Windows Calculator * declare long ShellExecute in "shell32.dll" long hwnd, string lpszOp,string lpszFile, string lpszParams,string lpszDir, long nShowCmd declare long GetDesktopWindow in"win32api" local hDCScreen hDCScreen = GetDesktopWindow() ShellExecute( hDCScreen, "open", "calc.exe", "", "d:\", 1)

(VFP) - Change Resolution on your Screen

Function ChangeRes && Author: Alexandre Hédréville && Cambia la resolución de la pantalla && Sintaxis: ChangeRes(tnWidth, tnHeight) && Valor devuelto: llRetVal && Argumentos: tnWidth, tnHeight && tnWidth especifica la nueva anchura de la pantalla en pixels && tnHeight especifica la nueva altura de la pantalla en pixels LPARAMETERS tnWidth, tnHeight LOCAL lnWidth, lnHeight, lnModeNum, lcDevMode && Valores lnModeNum = 0 lcDevMode = REPLICATE(CHR(0), 156) lnWidth = IIF(EMPTY(tnWidth), 800, tnWidth) lnHeight = IIF(EMPTY(tnHeight), 600, tnHeight) && Instrucciones DECLARE DLL para cambiar resolución DECLARE INTEGER EnumDisplaySettings IN Win32API ; STRING lpszDeviceName,; INTEGER iModeNum, ; STRING @lpDevMode DECLARE INTEGER ChangeDisplaySettings IN Win32API STRING @lpDevMode, INTEGER dwFlags && Bucle para obtener todos los modos di

(VFP) - How to insert simple Progress Bar

************************************************** ** The following shows Records for progress bar ** ************************************************** ** Create By : Leosan ** ** Date Create : 22-12-2004 Time 08.00 am ** ** Class Name : ProgressingBar ** ** Form : ProgressingBar ** ** ParentClass : form ** ** BaseClass : form ** ** Time Stamp : 22/12/2004 08:09:04 AM ** ************************************************** DEFINE CLASS ProgressingBar AS form Height = 70 Width = 408 AutoCenter = .T. BackColor = RGB(240,240,240) BorderStyle = 3 Caption = "" Closable = .F. ControlBox = .F. MaxButton = .F. MinButton = .F. Movable = .F. AlwaysOnTop = .f. ShowWindow = 1 Name = "ProgressBar" ADD OBJECT shape1 AS shape WITH ; Curvature = 10, ; Top = 6, ; Left

(VFP) - Utility to Rebuild CDX File...

********************************************************** ** Utility to ReBuild CDX index files. ********************************************************** ** Author : Ramani (Subramanian.G) ** FoxAcc Software / Winners Software ** Type : Freeware with reservation to Copyrights ** Warranty : Nothing implied or explicit ** Last modified : 19 November, 2004 ********************************************************** ** Function to rebuild CDX index ... this does.... ** First deletes the index and then recreates them ** How to ... ** Save this file as BuildIndex.PRG ** or add to your library as BuildIndex ** =BuildIndex(myDBF) ********************************************************* ** FUNCTION BuildIndex PARAMETERS myDBF IF PARAMETERS() # 1 RETURN .F. ENDIF LOCAL laIndex, cKey, cIndex USE (myDBF) DIMENSION laIndex(254,3) ** Load the index name and key names in array FOR nCount = 1 TO 254 IF !EMPTY(TAG(nCount)) && Checks for tags in the index

(VFP) - Search Char in Word

vword = 'MICROSOFT#VISUAL#FOXPRO#SEDNA_SP2' v1 = GETWORDNUM(vword,1,'#') v2 = GETWORDNUM(vword,2,'#') v3 = GETWORDNUM(vword,3,'#') v4 = GETWORDNUM(vword,4,'#')

(RPG) - RPG/400 Tutorial

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/sc09-1817-00.html

(General) - Connection String For Programming

http://www.connectionstrings.com/

(VFP) - A sample seach form

********************************************************* ** Author : Ramani (Subramanian.G) ** FoxAcc Software / Winners Software ** ramani_vfp@yahoo.com ** Type : Freeware with reservation to Copyrights ** Warranty : Nothing implied or explicit ********************************************************* ** How to Run.. ** 1. Save the following code as gsSearch.PRG ** 2. From the command window run that ** DO gsSearch ********************************************************* ** gsSearch.prg ********************************************************* CREATE CURSOR test (cName C(20), email c(20)) INSERT INTO test (cName, email) VALUES ("experts","experts@Tek_tips.moc") INSERT INTO test (cName, email) VALUES ("Dummy","dummy@dummy.moc") INSERT INTO test (cName, email) VALUES ("ClayHead","clay@dummy.moc") INSERT INTO test (cName, email) VALUES ("WoodBrain","wood@dummy.moc") INSERT INT

(VFP) - How to extract duplicate records from a table ?

How to extract duplicate records from a table ? By duplicate, I do not mean the replica of one record in another. For example, a sigle field such as Account_Id field may be existing twice or more number of times in a table, while the rest of the records content could be different. Or simply two fields concatenated may exist more than once in the same table. We can quickly obtain a list of such field values (let us call it duplicated records) with the code.... SELECT account_id FROM customer GROUP BY account_id ; HAVING COUNT(account_id) > 1 OR SELECT first_name + last_name AS cust_name ; FROM customer GROUP BY first_name + last_name ; HAVING COUNT(first_name + last_name) > 1 The above only picks up the field values which has duplicate records, while all the duplicated records are not listed. With the following code, we can get the full list of duplicated records. SELECT * FROM customer WHERE account_id IN ; (SELECT account_id FROM customer GROUP BY account_id ;

(VFP) - Running Visual FoxPro on Linux

Running Visual FoxPro on Linux By Paul McNett (FoxTalk, March 2003) While Microsoft publicly refuses to release Visual FoxPro for alternate platforms, there's still hope for a multi-platform VFP. Using an open-source product called Wine, Paul McNett shows how we can take matters into our own hands and put the fox on Linux ourselves. Remember last century, when one of FoxPro's greatest selling points was its ability to run and deploy to not one, not two, not three, but four separate platforms? This was a powerful selling point for me when I was choosing my development environment: Even though I only ever deployed to Windows, it was reassuring to know I wouldn't be painted into a corner should a client ask about a Mac, Unix, or DOS version of my software. Contrast that to today: As new versions of Visual FoxPro emerge with their great features and fixes, I keep finding myself thinking that our situation as VFP developers is pretty dire, being limited to developing and deployi

(VFP) - How to make menu appear in my form

1. Open the menu (modify menu), the menu gets opened with the wizard... then ... Choose from the system menu..View..GeneralOptions. Select Top-Level Form... Click OK 2. Again from the system menu ... choose ... Menu... Generate... Generate This will generate the menu mpr file 3. Now open the main form. Set in the properties, ShowWindow = 2 && As top level form In the InitEvent of the form.. put the code DO myMenu.MPR WITH THIS 4. Compile and run

(VFP) - How to put calendar on your vfp application

DEFINE CLASS form1 AS form Height = 239 Width = 286 ShowWindow = 1 DoCreate = .T. AutoCenter = .T. Caption = "Calendar" MaxButton = .F. MinButton = .F. Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; AutoSize = .F., ; Top = 204, ; Left = 82, ; Height = 27, ; Width = 55, ; Caption = "\ Name = "Command1" ADD OBJECT olecontrol1 AS olecontrol WITH ; Top = 0, ; Left = -1, ; Height = 200, ; Width = 289, ; Name = "Olecontrol1" ADD OBJECT command2 AS commandbutton WITH ; AutoSize = .F., ; Top = 204, ; Left = 149, ; Height = 27, ; Width = 54, ; Caption = "\ Name = "Command2" PROCEDURE Init SET DATE BRITISH PUBLIC OCAL AS DATE THISFORM.OleControl1.OBJECT.DAY = DAY(DATETIME()) THISFORM.OleControl1.OBJECT.MONTH = MONTH(DATETIME()) THISFORM.OleControl1.OBJECT.YEAR = YEAR(DATETIME()) ENDPROC PROCEDURE command1.Click OCAL = SUBSTR(DTOC(THISFORM.OLEcontrol1.OBJECT.Va

(VFP) - How to Pack data automaticaly

This code show u how to do it ****************** PARAMETERS myDataDir SET EXCLUSIVE ON LOCAL aFiles, nCount, I DIMENSION aFiles(1,1) nCount = ADIR(aFiles,mydataDir+"\"+"*.DBF") =ASORT(aFiles,1) I=1 FOR I = 1 TO nCount WAIT WINDOW "Reindexing "+aFiles(I,1)+ ; " ... Please wait" NOWAIT SELECT 0 USE mydataDir+"\"+(aFiles(I,1)) PACK USE WAIT CLEAR ENDFOR SET EXCLUSIVE OFF RETURN

(VFP) - How to include splash screen..

You can use this generic routine for display your splash screen Put code in main program ********* HIDE WINDOW SCREEN DO FORM SPLASH =INKEY(3,[H]) *** display 3 second appear on your screen SHOW WINDOW SCREEN

Welcome to my share about computer and VFP

The main purpose of starting this page is to share my Visual FoxPro related interests. As time proceeds, I will decide what more I can add in here. It all depends on the encouragement and success by way of feedbacks and comments of browsing members. There will be frequent changes as I keep building this site. Please bookmark this site and visit as often as you like. When you copy what you find from this site and provide the same to some one else or quote a piece of code somewhere, please make sure to tell where you found it and make a reference to this site. Probably they can derive greater benefits from visiting this site. If you feel that this site has benefited you considerably, tell a prayer for the benefit of my dependents and me at your next prayer time.