I have been toying with the idea of mimicking MS Outlook's way of handling email addresses being keyed-in in the To, Cc and Bcc entry fields. Here is my take on that: Public oform1
oform1=Newobject("form1")
oform1.Show
Return
**************************************************
*-- Form: form1 (c:\temp\form1.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 06/06/08 09:55:13 AM
*
Define Class form1 As Form
Top = 0
Left = 0
Height = 128
Width = 482
DoCreate = .T.
Caption = "Form1"
Name = "FORM1"
Add Object text1 As TextBox With ;
FontName = "Verdana", ;
FontSize = 8, ;
Height = 21, ;
Left = 12, ;
Top = 24, ;
Width = 458, ;
Name = "Text1"
Add Object edit1 As EditBox With ;
FontName = "Verdana", ;
FontSize = 8, ;
Height = 49, ;
Left = 12, ;
Top = 60, ;
Width = 459, ;
Name = "Edit1"
Procedure _selectaddr
Lparameters oControl
Local cSep,cText,nCntSep,nSelFr,;
lnX,lnY,nFr,nTo,nSelLen,nAdd
Local Array aPos(1)
cSep = ";"
cText = Alltrim(oControl.Value)
nCntSep = Occurs(cSep,cText)
nSelFr = oControl.SelStart
Dimension aPos(nCntSep+1)
aPos(1) = 0
For lnX = 2 To nCntSep+1)
aPos(lnX) = At(cSep,oControl.Value,lnX-1)
Next
If Right(cText,1) <> cSep
nAdd = Alen(aPos,1)+1
Dimension aPos(nAdd)
aPos(nAdd) = Len(cText)
Endif
nFr = 0
nTo = 0
For lnY = 1 To Alen(aPos,1)
If aPos(lnY) <= nSelFr
nFr = aPos(lnY)
Endif
If aPos(lnY) >= nSelFr And nTo = 0
nTo = aPos(lnY)
Endif
Next
nSelLen = nTo - nFr
With oControl
.SelStart = nFr
.SelLength = Iif(nSelLen<=0,1,nSelLen)
Endwith
Endproc
Procedure Init
* sample email addresses in textbox and editbox
With This
.text1.Value = "myemail@company.com.sg;customer@sales.com;erik@gomex.com"
.edit1.Value = "myemail@company.com.sg;customer@sales.com;erik@gomex.com"
Endwith
Endproc
Procedure text1.Click
This.Parent._SelectAddr(This)
Endproc
Procedure edit1.Click
This.Parent._SelectAddr(This)
Endproc
Enddefine
*
*-- EndDefine: form1
**************************************************
Feedbacks are always welcome. Please feel free to use and improve the above code.
Just want to share this. This has been with me for some time now and have used this in several applications in the past. Hope that someone will find this useful.
**************************************************
*-- Form: mapnet (d:\vfp_projects\mapnet.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 11/20/06 11:28:12 AM
*
Define Class mapnet As Form
Height = 108
Width = 469
DoCreate = .T.
AutoCenter = .T.
Caption = "Map Network Drive"
ControlBox = .F.
Closable = .F.
Name = "MapNet"
Add Object command2 As CommandButton With ;
Top = 48, ;
Left = 324, ;
Height = 23, ;
Width = 24, ;
FontBold = .T., ;
Caption = "...", ;
TabIndex = 5, ;
Name = "Command2"
Add Object combo1 As ComboBox With ;
Height = 24, ;
Left = 48, ;
Sorted = .T., ;
Style = 2, ;
TabIndex = 2, ;
Top = 12, ;
Width = 300, ;
Name = "Combo1"
Add Object label1 As Label With ;
AutoSize = .T., ;
Caption = "\<Drive", ;
Height = 17, ;
Left = 12, ;
Top = 17, ;
Width = 30, ;
TabIndex = 1, ;
Name = "Label1"
Add Object label2 As Label With ;
AutoSize = .T., ;
Caption = "\<Path", ;
Height = 17, ;
Left = 12, ;
Top = 48, ;
Width = 27, ;
TabIndex = 3, ;
Name = "Label2"
Add Object text1 As TextBox With ;
Height = 23, ;
Left = 48, ;
TabIndex = 4, ;
Top = 48, ;
Width = 276, ;
Name = "Text1"
Add Object cmdmap As CommandButton With ;
Top = 12, ;
Left = 372, ;
Height = 27, ;
Width = 84, ;
Caption = "\<OK", ;
TabIndex = 6, ;
Name = "cmdMap"
Add Object cmdcancel As CommandButton With ;
Top = 48, ;
Left = 372, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Cancel", ;
TabIndex = 7, ;
Name = "cmdCancel"
Add Object check1 As Checkbox With ;
Top = 84, ;
Left = 48, ;
Height = 17, ;
Width = 128, ;
AutoSize = .T., ;
Alignment = 0, ;
Caption = "\<Reconnect at Logon", ;
Value = .T., ;
Name = "Check1"
Procedure getunc
* Program....: GetUNCPath.prg
* Version....: 1.0
* Author.....: Andrew Coates
* Date.......: September 28, 1998
* Notice.....: Copyright © 1998 Civil Solutions, All
* Rights Reserved.
* Compiler...: Visual FoxPro 05.00.00.0415 for Windows
* Abstract...: Wrapper to the API call that converts a
* mapped drive path to the UNC path
* Changes....:
* Originally used WNetGetUniversalName, but that
* doesn't work under Win95 (see KB Q131416). Now uses
* WNetGetConnection which uses a string rather than a
* structure so STRUCTURE_HEADER is now 0
Lparameters tcMappedPath, tnBufferSize
* from winnetwk.h
#Define UNIVERSAL_NAME_INFO_LEVEL 0x00000001
#Define REMOTE_NAME_INFO_LEVEL 0x00000002
* from winerror.h
#Define NO_ERROR 0
#Define ERROR_BAD_DEVICE 1200
#Define ERROR_CONNECTION_UNAVAIL 1201
#Define ERROR_EXTENDED_ERROR 1208
#Define ERROR_MORE_DATA 234
#Define ERROR_NOT_SUPPORTED 50
#Define ERROR_NO_NET_OR_BAD_PATH 1203
#Define ERROR_NO_NETWORK 1222
#Define ERROR_NOT_CONNECTED 2250
* local decision - paths are not likely to be longer
* than this - if they are, this function calls itself
* recursively with the appropriate buffer size as the
* second parameter
#Define MAX_BUFFER_SIZE 500
* string length at the beginning of the structure
* returned before the UNC path
* ACC changed to 0 on 9/10/98 - Now using
* WnetGetConnection which uses a string rather than a
* struct
#Define STRUCTURE_HEADER 0
Local lcReturnValue
If Type('tcMappedPath') = "C" And ! Isnull(tcMappedPath)
* split up the passed path to get just the drive
Local lcDrive, lcPath
* just take the first two characters - we'll put it
* all back together later. If the first two
* characters are not a valid drive, that's OK. The
* error value returned from the function call will
* handle it.
* case statement ensures we don't get the "cannot
* access beyond end of string" error
Do Case
Case Len(tcMappedPath) > 2
lcDrive = Left(tcMappedPath, 2)
lcPath = Substr(tcMappedPath, 3)
Case Len(tcMappedPath) <= 2
lcDrive = tcMappedPath
lcPath = ""
Endcase
Declare Integer WNetGetConnection In WIN32API ;
STRING @lpLocalPath, ;
STRING @lpBuffer, ;
INTEGER @lpBufferSize
* set up some variables so the appropriate call can
* be made
Local lcLocalPath, lcBuffer, lnBufferSize, ;
lnResult, lcStructureString
* set to +1 to allow for the null terminator
lnBufferSize = Iif(Pcount() = 1 Or Type('tnBufferSize') # "N" Or Isnull(tnBufferSize), ;
MAX_BUFFER_SIZE, ;
tnBufferSize) + 1
lcLocalPath = lcDrive
lcBuffer = Space(lnBufferSize)
* now call the dll function
lnResult = WNetGetConnection(@lcLocalPath, @lcBuffer, @lnBufferSize)
Do Case
* string translated sucessfully
Case lnResult = NO_ERROR
* Actually, this structure-stripping is no longer
* required because WnetGetConnection() returns a
* string rather than a struct
lcStructureString = Alltrim(Substr(lcBuffer, STRUCTURE_HEADER + 1))
lcReturnValue = Left(lcStructureString, ;
at(Chr(0), lcStructureString) - 1) + lcPath
* The string pointed to by lpLocalPath is invalid.
Case lnResult = ERROR_BAD_DEVICE
lcReturnValue = tcMappedPath
* There is no current connection to the remote
* device, but there is a remembered (persistent)
* connection to it.
Case lnResult = ERROR_CONNECTION_UNAVAIL
lcReturnValue = tcMappedPath
* A network-specific error occurred. Use the
* WNetGetLastError function to obtain a description
* of the error.
Case lnResult = ERROR_EXTENDED_ERROR
lcReturnValue = tcMappedPath
* The buffer pointed to by lpBuffer is too small.
* The function sets the variable pointed to by
* lpBufferSize to the required buffer size.
Case lnResult = ERROR_MORE_DATA
lcReturnValue = getuncpath(tcMappedPath, lnBufferSize)
* None of the providers recognized this local name
* as having a connection. However, the network is
* not available for at least one provider to whom
* the connection may belong.
Case lnResult = ERROR_NO_NET_OR_BAD_PATH
lcReturnValue = tcMappedPath
* There is no network present.
Case lnResult = ERROR_NO_NETWORK
lcReturnValue = tcMappedPath
* The device specified by lpLocalPath is not
* redirected.
Case lnResult = ERROR_NOT_CONNECTED
lcReturnValue = tcMappedPath
Otherwise
lcReturnValue = tcMappedPath
Endcase
Else
lcReturnValue = tcMappedPath
Endif
Return lcReturnValue
Endproc
Procedure Error
Lparameters nError, cMethod, nLine
Messagebox(Str(nError) + 'Please chose a valid network resource to map.',;
64,This.Caption)
Endproc
Procedure Init
Declare Integer WNetAddConnection In MPR.Dll String cNetPath, String;
cPassword, String cLocalName
Declare Integer WNetCancelConnection In MPR.Dll String cName, Long nForce
Declare Integer WNetGetConnection In WIN32API String cLocalName, String;
@cNetPath, Integer @nLen
Endproc
Procedure command2.Click
Local lcNetDrive
lcNetDrive = Getdir('','Select Network Resource',;
'Browse for Network Drive')
With This.Parent
lcNetDrive = .getunc(lcNetDrive)
.text1.Value = lcNetDrive
.text1.Refresh
Endwith
Endproc
Procedure combo1.Init
Local lnFirstDrv,lnLastDrv,lcDrive,lnCnt,lnDrvType
lnFirstDrv = Asc('A')
lnLastDrv = Asc('Z')
For lnCnt = lnFirstDrv To lnLastDrv
lcDrive = Chr(lnCnt) + ':'
lnDrvType = Drivetype(lcDrive)
Do Case
Case lnDrvType = 1 And lcDrive <> 'B:' && No type
This.AddItem(lcDrive)
Case lnDrvType = 2 && Floppy disk
Case lnDrvType = 3 && Hard disk
Case lnDrvType = 4 && Removable drive or network drive
*this.AddItem(lcDrive)
Case lnDrvType = 5 && CD-ROM
Case lnDrvType = 6 && RAM disk1
Endcase
Next
loWSHNet = Createobject('Wscript.Network')
loNetDrives = loWSHNet.EnumNetworkDrives
For lnX = 1 To loNetDrives.Count-1 Step 2
lcDrive = '\' + loNetDrives.Item(lnX-1) + ' ' + loNetDrives.Item(lnX)
This.AddItem(lcDrive)
Next
loWSHNet = .Null.
loNetDrives = .Null.
Endproc
Procedure cmdmap.Click
Local loWSHNet,lcDrive,lcPath,lnRetVal,lcMess,llReconnect
With This.Parent
lcDrive = Left(Alltrim(.combo1.Value),2)
lcPath = Alltrim(.text1.Value)
llReconnect = .check1.Value
If Empty(lcDrive) Or Isblank(lcDrive)
Messagebox('Please select Drive to map.',64,.Caption)
Return
Endif
If Empty(lcPath) Or Isblank(lcPath)
Messagebox('Please select Path.',64,.Caption)
Return
Endif
* lnRetVal = WNetAddConnection(lcPath,'',lcDrive)
loWSHNet = Createobject("Wscript.Network")
loWSHNet.MapNetworkDrive(lcDrive,lcPath,llReconnect)
loWSHNet = .Null.
.Release
Endwith
Endproc
Procedure cmdcancel.Click
Thisform.Release
Endproc
Enddefine
*
*-- EndDefine: mapnet
**************************************************
It's a pity that my post after a long time is a sad one. My mother had a stroke this morning and she is being brought to the hospital as I'm typing this post. I don't have all the details yet but have spoken to my father and he told me that her blood pressure is 150/100. I feel very sad and helpless as I can't be there for my mother. Please spare some time to pray for my mother. Thanks.
Read articles (about soccer in the Philippines) written by a very good friend of mine (Jack Biantan from London) at http://pinoysoccer.com/home/
To Jack :
More power to you Jack and I'm glad you have taken up writing (sports articles) again, I know how you loved to write sports related articles.
And big thanks for the England World Cup jersey you have sent ![Smile [:)]](/emoticons/emotion-1.gif)
It's been a while since I've last posted something in my weblog related to VFP. I have been using this code for a long time in one of my apps and have actually posted it in the forum sometime last year or maybe 2 years ago and just recently. Anyways, for those who might need it here it is. Some amount of work may still be required to polish this.
Public oForm
oForm = Createobject('mySplitter')
oForm.Show
Return
Define Class mySplitter As Form
Top = 0
Left = 0
Height = 371
Width = 373
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
nxtwips = .F.
nytwips = .F.
Add Object edit1 As EditBox With ;
Height = 62, ;
Left = 0, ;
Top = 5, ;
Width = 365, ;
Name = "Edit1"
Add Object edit2 As EditBox With ;
Height = 285, ;
Left = 0, ;
Top = 77, ;
Width = 365, ;
Name = "Edit2"
Add Object shape1 As Shape With ;
Top = 71, ;
Left = 0, ;
Height = 3, ;
Width = 358, ;
MousePointer = 7, ;
SpecialEffect = 0, ;
Name = "Shape1"
Procedure _resize
Lparameters lnYCoord
With This
Wait Window Transform(lnYCoord) Nowait
lnOffset = lnYCoord - .edit1.Height - 8
.edit1.Height = .edit1.Height + lnOffset
.shape1.Top = lnYCoord
.edit2.Top = lnYCoord + 4
.edit2.Height = .Height - (lnYCoord + 8)
Endwith
Endproc
Procedure shape1.Drag
Lparameters nAction
Wait Window Transform(nAction) Nowait
Endproc
Procedure shape1.MouseDown
Lparameters nButton, nShift, nXCoord, nYCoord
lcMsg = 'nButton = ' +Transform(nButton) + Chr(13) +;
'nShift = ' +Transform(nShift) + Chr(13) +;
'nXCoord = ' +Transform(nXCoord) + Chr(13) +;
'nYCoord = ' +Transform(nYCoord)
Wait Window lcMsg Nowait
Endproc
Procedure shape1.MouseMove
Lparameters nButton, nShift, nXCoord, nYCoord
If nButton = 1
Thisform._resize(nYCoord)
Endif
Endproc
Enddefine
My daughter Therese Erika turned three last October 15 and she had the "pabitin" (those hanging toys and candies in one of the pictures here) all for herself. The "pabitin" was a gift from her Tita Jo Ann (my wife's younger sister). I can see that she enjoyed her birthday party very much. It's one of those times in my daughter's life that I missed. I may also miss having Christmas and New Year with my family this time as I'm needed at the office for some prior tasks assigned to me.
As some of you may have known my then 2 year and 9 month old daughter battled the worst form of allergic reaction to an antibiotic. She had what was known as the Stevens-Johnson Syndrome or SJS. She was admitted to the hospital on the 6th of August 2005. Fortunately she responded very well to the medications that she was out of the hospital two weeks later.
I will not describe all of what my daughter had to endure but you can view photographs from this link: http://www.sjsupport.org/photo1.shtml. Please be advised that the photographs in this page are graphic!
Since she could not eat (her mouth had lesions as well), an IV line was needed. But every time medicines were needed to be given orally she'd cry because it meant pain in her mouth. So she'd move around and cry and bang her hands and feet. This resulted to her IV line getting dislodged almost every two days. She endured a total of 12 IV insertions and twice for blood extraction needed for a blood culture to determine if she had other allergies.
I arrived from Singapore in Bacolod last August 9, 2005 but have to shower and put on new clothes first before proceeding to the hospital. Shortly after I arrived, her IV line got dislodged and needed to be reinserted as she needs IV fluids because she is not eating or drinking anything. She was treated as if she had first degree burns. While the IV line was being reinserted, we held her down with small pillows as we couldn't use our hands because of the lesions and blisters on her skin. During this time, she cried so much and said in a harsh and pleading voice, "Mama, mama, puli na ta, kapoy na gid ko." which translates to "Mommy, Mommy, let's go home, I'm very tired." I was telling myself if only I could trade places with her. But it was a battle that she must fight and win on her own. All we could do was to pray for her, try to make her as comfortable as possible and give her whatever medicines she needs.
I know the doctors attributed her quick recovery to the early detection and diagnosis that what she had was SJS as well as the medicines that was given to her. But I truly believe that it was largely because of the prayers and concern from all the people I know personally and from those whom I’ve known only here at www.foxite.com .
Thus I would like to thank them. To everybody here at www.foxite.com but most especially to Eric den Doop and Simon Arnold (for the concern), Boudewijn Lutgerink (for the distant Reiki treatments), Sivaramakrishnan, Lucy and Dale (for the prayers).
To all my batchmates/e-group mates at http://groups.yahoo.com/group/DBSM84/ but most especially to Boy and Chita (for visiting), Joy (for calling), to Pangga, Maricor, John, Bernard and Noel (for the emails and prayers) and to Elrie (for facilitating my return ticket). To my relatives for their prayers and concern.
To Melissa for calling, praying and offering to take care of us if there was a need to bring my daughter to the U.S. for treatment.
To my parents, Mama and Papa, my brother TG and my sister Janet (for assisting and staying with us in the hospital).
To my in-laws, Dad, Mom, Jo Ann, Gani, Jun-jun, Jam-jam, Cristy, Ritchel for all the support, care and prayers.
To Tita Cita, for the bubble toy which gave my daughter so much joy that she forgot about the pain in her mouth that she started eating for the first time since she was confined in the hospital.
My thanks goes out most specially to my brother-in-law, Pep, for the financial support.
To my flat mates here in Singapore, Manong Boy, Chris, Carlo, Elaine, Grace and Rina for their prayers.
To Dr. Arroyo, Dr. Gallaga, Dr. Almais-Tan and Dr. Montilla for doing their best. To the nurses at Station 5, Marietta, Salve, Rose and Glenn as well as the other staff for helping us with all our needs during my daughter’s confinement.
To our friends, Tin-tin and Rodney, Vina and Maritess D. and Maritess C., for prayers and for visiting. I may not be able to mention everyone who in one way or another had helped us hurdle this obstacle and for making us feel that we are not alone in this. All I can say is that you know who you are and to you all, my heartfelt thanks. It really warms my heart to know that so many people were concerned of my daughter’s well being, some of whom I even haven't met.
To the Lord Almighty, for all the blessings and the healing.
The other person who endured as much as my daughter was my wife. You see, our daughter will only sleep on my wife's chest during her ordeal at the hospital. It was as if it's the only place where my daughter could seek comfort. I could only marvel at my wife's patience in taking care of our daughter. I know that during these times she was very very tired was suffering from headaches due to lack of sleep. To my wife Tess, I love you very much and I know I can't be there always but rest assured of my constant prayers.
My daughter Therese Erika (2 years 10 months old) is in the hospital right now and is suffering from Steven Johnson's Syndrone (SJS) an acute allergic reaction to an antibiotic that was prescribed for her urinary tract infection. Looking at websites about SJS I know that she is suffering so much and is in great pain. This disease is very serious that could lead to many complications. I won't mention these here as even by just thinking about the complications brings me so much pain. I truly wish I could trade places with my daughter right now. I'm planning to be there by the end of the week if not sooner. I would be very grateful if you could offer a prayer for my daughter. Thank you very much and may God bless you.
Around 3 months ago, I was tasked to look for manpower out-sourcing companies in the Philippines. In the course of my search I found two websites listing an IT services company whose contact person's name sounds familiar. After sometime I realized that the contact person of the said IT services company was an old college friend, whom I last saw in April of 1989. Imagine, after 16 years, I was able to get in-touch with her. Luckily one of the sites listed her maiden name and the other the contact information, if not then I could have not known that it was her. Here are the two site's I've mentioned :
http://www.eitsc.com/softdev_cytronics.html
http://www.itnetcentral.com/directory/profile.asp?id=453
It was the first time I experienced the power of the internet in a personal level. Anyway, in case some of our mutual friends would like to reach her, here are her contact details:
Josephine Bernadette P. Panganiban
VP - Systems and Services
CYTRONICS INTERNATIONAL, INC.
3/F Basic Petroleum Building,
104 Carlos Palanca Jr. Street,
Legaspi Village, Makati City
Phone: 867-1338 867-1340
Fax: 867-1339
I was reading Craig Boyd's Visual FoxPro Community Action and decided to heed to his call. I'm now preparing some materials on Microsoft Visual FoxPro that I would like to discuss with computer students in my high school Alma Mater, Don Bosco Technical Institute in Victorias City, Philippines. I will be having my annual vacation late December 2005 (before the Christmas) until mid-January 2006. This will give me some time to visit my high school Alma Mater. You see Don Bosco Technical Institute has a rather unique high school curriculum where-in students in the 3rd and 4th year high school are grouped (it's called a section) into three. One section is taking up basic electronics subjects, then the other is computer and mechanics. It is in this school where I got hold of my first computer, the TRS-80. The computer section curriculum is usually basic computer concepts, computer programming using Microsoft Visual FoxPro and some introduction to computer aided design and manufacturing (CAD/CAMM). My plan is to be able to have an informal talk to these students about computer programming in general and specifically Microsoft Visual FoxPro as one of the best tools in data-centric desktop applications development and hopefully instill in these young minds to be interested in using Microsoft Visual FoxPro when they reach college and if they decide to be computer programmers, use Microsoft Visual FoxPro as their main computer language of choice in developing data-centric applications.
I expect difficulties and challenges in completing this endeavor. Some of these are :
- coming up with a comprehensive set of materials that is brief and easily digested by high school students
- gaining the support of the school administration and the faculty
- hardware and software requirements
- availability of books and other types of resources on Microsoft Visual FoxPro
Hopefully I can overcome these challenges in due time.
This is just a very small step, but it can be a start of something big that will benefit not only these high school students but all Microsoft Visual FoxPro developers in general. The xbase language and eventually Microsoft Visual FoxPro as well as the Microsoft Visual FoxPro community, especially here at www.foxite.com have been very good to me. I guess this is my way of saying "THANK YOU". It is my fervent wish that this small step will ripple throughout the Microsoft Visual FoxPro community and eventually turn into a "giant wave" that will improve the state of Microsoft Visual FoxPro and elevate it into even greater heights.
I've been messing around with Python and the Dabo framework for sometime now to realize that Python is a great open source programming language and Dabo is surely a very strong and well written data-driven framework. Since the authors have strong backgroud and extensive experience in Visual FoxPro, the Dabo framework have a touch of Visual FoxPro in it that will make it attractive to Visual FoxPro developers. But don't get me wrong, I'm still climbing the Python/Dabo learning curve and will not abandon Visual FoxPro. But with Python/Dabo your app will run in Linux/Unix and Mac OS'es as well as Windows without any rewrite. It will open new possibilities for me as a developer. As with anyone who had the opportunity to work abroad, being multi-lingual is a very valuable asset. I guess this is also very true for a software developer in an ever changing computer landscape.
Naturaly, in learning a new programming language finding and getting hold of good books is a given. So yesterday I visited a popular computer bookstore here in Singapore. I was pleasantly surprised that there were at least 10 titles on Python on the shelf. So while I'm at it I decided to look for books on Visual FoxPro, but to my dismay I could not find any. I'm not whining about this, it's just that it can get to you sometimes. Well, I guess then it's up to us to continue doing our part in making Visual FoxPro well known by creating great Visual FoxPro applications and to share to everyone about the power of Visual FoxPro. One more thing, keep on blogging about Visual FoxPro for it is a very powerful means that we can let the world know about Visual FoxPro.
When I first started out using the net and got my first free email account, I used www.yahoo.com as it was the more famous web portal offering free web-baed email service. At that time it also offered free pop mail access your yahoo.com email account but decided to terminate it sometime later. It was a good thing to have (pop mail access) as you can check to your emails from virtually any email client. Well, yahoo still offers free pop mail access in its different country domains (i.e. yahoo.com.sg) but not from yahoo.com. Anyway, while searching the net for some way to have pop mail access to my yahoo.com emails, I came across YPops!, actually it was suggested to me a collegue. I've been using it with Mozilla's Thurderbird and Microsoft's Outlook XP for sometime now with no problems. You can find the instructions on how to configure the YPops! for use with the different email client applications here.
Recently as I was working on an email management application using MySQL Server, VFP8 and some email components from AdminSystem, a need to better distinguish the different status of emails (Read, Replied, Forwarded, Acknowledged, Flagged and so on) arose. So VFP grid's numerous property regarding forecolor and backcolor (static or dynamic) where put to good use. I got the inspiration from Mozilla's Thunderbird Email Client. Below is the test program I used and later improved and adapted in my email management application. DynamicCurrentControl was used to show different icons for the different email status. By the way, you can click on the grid's header to sort the records.
Public oForm
oForm = Newobject("form1")
oForm.Show
Return
**********************************************************
* class definition for form1
Define Class form1 As Form
Top = 0
Left = 0
Height = 340
Width = 381
DoCreate = .T.
Caption = "Grid Highlight"
Name = "form1"
ShowTips = .T.
Procedure Init
Public gvTypeA,gvTypeD,gvTypeR
gvTypeA = Rgb(255,0,0)
gvTypeD = Rgb(0,0,128)
gvTypeR = Rgb(64,128,128)
Select temp
Locate
This.AddObject('grid1','grid1')
This.grid1.Visible = .T.
Endproc
Procedure Load
* create cursor for temporary data
Create Cursor temp (cType c(1),cDesc c(40),nRand i)
lnFlds = Afields(laFlds,'temp')
For lnY = 1 To lnFlds
lcNdxNm = laFlds(lnY,1)
Index On &lcNdxNm Tag &lcNdxNm
Next
* create index for all fields
For lnX = 1 To 9
m.cType = 'R'
m.cDesc = m.cType + Space(2) + 'Description ' + Alltrim(Str(lnX))
m.nRand = Rand() * 100
Insert Into temp From Memvar
Next
For lnX = 1 To 9
m.cType = 'A'
m.cDesc = 'Description ' + m.cType + Space(2) + Alltrim(Str(lnX))
m.nRand = Rand() * 100
Insert Into temp From Memvar
Next
For lnX = 1 To 9
m.cType = 'D'
m.cDesc = Alltrim(Str(lnX)) + Space(2) + m.cType + Space(2) + 'Description'
m.nRand = Rand() * 100
Insert Into temp From Memvar
Next
Endproc
Procedure Unload
Release gvTypeA,gvTypeD,gvTypeR
Endproc
Enddefine
* end class definition for form1
**********************************************************
* class definition for grid
Define Class grid1 As Grid
ColumnCount = 3
FontSize = 8
DeleteMark = .F.
Height = 313
Left = 13
Panel = 1
RowHeight = 17
Top = 12
Width = 354
Name = "Grid1"
GridLines = 0
Procedure Init
With This
lcForeColor = "Iif(cType='R',gvTypeR,Iif(cType='D',gvTypeD,gvTypeA))"
.RecordSource = 'temp'
.HighlightStyle = 2
.SetAll('DynamicForeColor',lcForeColor,'column')
.HighlightBackColor = Evaluate(.Column1.DynamicForeColor)
.HighlightForeColor = Rgb(255,255,255)
.SetAll('SelectedBackColor',.HighlightBackColor ,'textbox')
.SetAll('SelectedForeColor',.HighlightForeColor ,'textbox')
With .Column1
.ControlSource = 'cType'
.FontSize = 8
.Width = 36
.RemoveObject('header1')
.AddObject('header1','header1')
.header1.Caption = "Type"
Endwith
With .Column2
.ControlSource = 'cDesc'
.FontSize = 8
.Width = 206
.RemoveObject('header1')
.AddObject('header1','header1')
.header1.Caption = "Description"
Endwith
With .Column3
.ControlSource = 'nRand'
.FontSize = 8
.Width = 75
.RemoveObject('header1')
.AddObject('header1','header1')
.header1.Caption = "Number"
Endwith
.Refresh
Endwith
Endproc
Procedure AfterRowColChange
Lparameters nColIndex
With This
.HighlightBackColor = Evaluate(.Column1.DynamicForeColor)
.HighlightForeColor = Rgb(255,255,255) && white
.SetAll('SelectedBackColor',.HighlightBackColor ,'textbox')
.SetAll('SelectedForeColor',.HighlightForeColor ,'textbox')
Endwith
Endproc
Enddefine
* end class definition for grid
**********************************************************
* class definition for Header
Define Class header1 As Header
Tag = 'A'
FontSize = 8
ToolTipText = 'Click here to sort'
Procedure Click
Local lcNdx,lcOrder,lcAlias
With This
If .Tag = 'A'
lcOrder = 'Ascending'
.Tag = 'D'
Else
lcOrder = 'Descending'
.Tag = 'A'
Endif
lcNdx = .Parent.ControlSource
lcAlias = .Parent.Parent.RecordSource
Select (lcAlias)
Set Order To &lcNdx &lcOrder
.Parent.Parent.Refresh
Endwith
Endproc
Enddefine
* end class definition for Header
Maybe somebody can put this into good use. Please feel free to send feedbacks and/or comments.
A few months back, I was asked to consolidate all the graphics related files (jpg, bmp, gif ad etc.) for a certain VFP project. So I proceeded to transfer all graphics file into one folder. At the same time forms where transferred to a new folder as well. I know that if you just set the correct path with the SET PATH command all will be well when you open the project for the first time. But as it happened the path was not set up correctly when the project was opened VFP, thus most of the forms lost it's reference to the graphics file in the PICTURE and ICON property.
I know that when the project is eventually compiled into an executable all the necessary graphics files will be included in the project and thus will display correctly in the form at runtime. But opening the form in VFP at development time, all the graphics are not displayed in the corresponding controls (buttons, image controls and the like). It will be tedious to open each form and point the picture and icon properties to the corresponding graphics file in the correct location. I don't know if there is an easier way to do this, but I made a short program to take care of this difficulty. This program assumes that all the forms are located in one folder and the graphics files are all in another folder. This program was developed in VFP7. Please note that this program opens the individual forms as a table, thus taking a back-up of all the forms is recommended.
lcPath = Getdir("","Forms Path","",64,.F.)
lcPixPath = Getdir("","Graphics Path","",64,.F.)
If Empty(lcPath) Or Empty(lcPixPath)
lcMess = "Please select Forms path and Graphics Files Path"
Messagebox(lcMess,48,"Error")
Return
Endif
lnFiles = Adir(laFiles,lcPath + "*.scx","A",1)
lcMsg = ""
For lnX = 1 To lnFiles
If Used(laFiles(lnX,1))
Select (laFiles(lnX,1))
Use
Endif
Use (lcPath + laFiles(lnX,1))
Wait Window "Processing : " + Alias() Nowait
Scan For Upper(BaseClass) = "COMMANDBUTTON" Or;
Upper(BaseClass) = "IMAGE" Or Upper(BaseClass) = "FORM"
lnLines = Alines(laLines,Properties,.T.)
lcMsg = ""
lcOld = Properties
For lnY = 1 To lnLines
lnStart = 0
lnStart = At("PICTURE = ",Upper(laLines(lnY)))
If lnStart <> 0
lcNewPath = ""
lnLen = Len(laLines(lnY))
lnEqSign = At("=",laLines(lnY))
lcFullNm = Alltrim(Right(laLines(lnY),lnLen-lnEqSign))
lcFilenm = Justfname(lcFullNm)
If !Empty(lcFilenm)
lcNewPath = "Picture = " + lcPixPath + lcFilenm
Else
lcNewPath = "Picture = """
Endif
If lnY = lnLines
lcMsg = lcMsg + lcNewPath
Else
lcMsg = lcMsg + lcNewPath + Chr(13) + Chr(10)
Endif
Else
lnStart = 0
lnStart = At("ICON = ",Upper(laLines(lnY)))
If lnStart <> 0
lcNewPath = ""
lnLen = Len(laLines(lnY))
lnEqSign = At("=",laLines(lnY))
lcFullNm = Alltrim(Right(laLines(lnY),lnLen-lnEqSign))
lcFilenm = Justfname(lcFullNm)
If !Empty(lcFilenm)
lcNewPath = "Icon = " + lcPixPath + lcFilenm
Else
lcNewPath = "Icon = """
Endif
If lnY = lnLines
lcMsg = lcMsg + lcNewPath
Else
lcMsg = lcMsg + lcNewPath + Chr(13) + Chr(10)
Endif
Else
If lnY = lnLines
lcMsg = lcMsg + laLines(lnY)
Else
lcMsg = lcMsg + laLines(lnY) + Chr(13) + Chr(10)
Endif
Endif
Endif
Next
If !Empty(lcMsg)
Replace Properties With lcMsg
Endif
Endscan
Next
Messagebox("Process completed.",64,"Process")
Close Tables All
As always comments are welcome.
Early this week (04 April, Monday) my folks (mom and dad) called to inform me that they are fetching my wife and kid today to go to this famous mountain resort called the Mambukal Mountain Resort. My folks live in Victorias City, so they will be travelling for about 61 kilometers to the resort. This place's great. Mambukal Resort lies 1,200 feet above sea level and serves as a gateway to the Mt. Kanlaon Volcano. Well, surely they will be having loads of fun there, while I'll be stuck here infront of my PC doing what else... VFP programming of course. I'll be starting a new project soon (I'll post more info on this later)
For those who don't know, my wife and daughter are living in Bacolod in the Province of Negros Occidental in the Philippines while I'm here in Singapore.
Just a note, the word “Mambukal” comes from the root word “bukal” which means boil. It was so named because of the numerous hot sulfur springs whose medicinal waters are a balm for the weary flesh and continually feeds a warm dipping pool.