Keyboard Shortcuts
Likes
- MadFox
- Messages
Search
Re: Attention Mr. Selje
Eric Selje
toggle quoted message
Show quoted text
|
Re: COM and VFP6
P.J. Fernandez
Should use 7.0 or 8.0. It has better COM support.
toggle quoted message
Show quoted text
P.J.
|
New file uploaded to madfox_vfp
Hello,
This email message is a notification to let you know that a file has been uploaded to the Files area of the madfox_vfp group. File : /Meeting Uploads/Feb04/mover.zip Uploaded by : jtllodi <jtlodi@...> Description : Mover Boxes You can access this file at the URL To learn more about file sharing for your group, please visit Regards, jtllodi <jtlodi@...> |
February Meeting
P.J. Fernandez
Talked about:
1. Wine VFP (file added to the file area) 2. Outlook Automation (How to send spam!) **** #DEFINE EmailItem 0 #DEFINE OutboxFolder 4 LOCAL oOutlook, oMessage, oAttachment, oOutboxFolder, oOutlookSpace LOCAL llHotmail, lcFileName, lcText, lnOutboxItems, lnBytes, lcTempFileName, lcTempText LOCAL lcLeadsTable, lnLatestBatch, lnRand, lcHTMLBody CLOSE DATA ALL lcTable = [RF_Announce] lnRand = INT( RAND( -1 ) ) oOutlook = CreateObject( "Outlook.Application" ) IF VARTYPE( oOutlook ) # [O] MESSAGEBOX( [Error creating Outlook object. Quitting ....] ) RELEASE oMessage, oOutlook, oAttachment, oOutlookFolder, oOutlookSpace RETURN ENDIF SET MEMOWIDTH TO 2000 IF USED( [Announce] ) USE IN Announce ENDIF USE ( lcTable ) IN 0 SHARED ALIAS Announce SELECT Announce LOCATE lcHTMLBody = FILETOSTR( [Announcement.htm] ) SCAN oMessage = oOutlook.CreateItem( EmailItem ) IF VARTYPE( oMessage ) # [O] MESSAGEBOX( [Error creating Outlook's Message object. Quitting ....] ) LOOP ENDIF oMessage.To = ALLTRIM( announce.Address ) oMessage.Subject = "Hires Marketing Executive" oMessage.HTMLBody = lcHTLMBody oMessage.SEND( ) oMessage = .F. lnRand = INT( 7 * RAND( ) ) + 1 WAIT WINDOW [Waiting some time before processing the next one....]; + ALLTRIM( announce.Address ) TIMEOUT ( lnRand ) ENDSCAN RELEASE oMessage, oOutlook, oAttachment, oOutlookFolder, oOutlookSpace ** 3. Excel Automation $#&^%#&% Frustration *&&^%*$^%R*&@@@@@ CLEAR ALL SET STEP ON #Include excel9.h #DEFINE False .F. #DEFINE True .T. loExcel = CREATEOBJECT("Excel.Application") loExcel.SheetsInNewWorkbook = INT(1) loWorkBook = loExcel.WorkBooks.Add loExcel.Visible = .T. loSheet = loExcel.Sheets(1) loSheet.NAME = [MadFox] loSheet.Cells(1,1).Value = [Test] loSheet.Cells(1,2).Value = 3 loSheet.Cells(2,1).Value = [Test2] loSheet.Cells(2,2).Value = 8 lcRange = [A1:B2] loSheet.Range( lcRange ).Copy *loExcel.CutCopyMode = .F. loSheet.Range("A5").Select SET STEP ON *loSheet.Range("A5").PasteSpecial( xlPasteAll, xlPasteSpecialOperationNone, False, True ) *loSheet.Range("A5").PasteSpecial( xlAll, xlNone, False, True) RELEASE ALL *PJ* Sub Macro1() *PJ* ' *PJ* ' Macro1 Macro *PJ* ' Macro recorded 2/17/2004 by fernanpf *PJ* ' *PJ* ' *PJ* Range("A1:B2").Select *PJ* Selection.Copy *PJ* Range("A5").Select *PJ* Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _ *PJ* , Transpose:=True *PJ* End Sub 4. TextPad editor for Java programming. 5. View Definition brings h files into view. (VFP 8.0) 6. Mover Class - see file on the website. Thanks for coming... We enjoyed the cake very much! P.J & the rest of the gang.... |
Re: February Meeting
Stein Goering
For what it's worth...
The code below runs without error: ** CLEAR ALL *SET STEP ON *#Include excel9.h #DEFINE False .F. #DEFINE True .T. *#Include excel9.h #DEFINE False .F. #DEFINE True .T. loExcel = CREATEOBJECT("Excel.Application") loExcel.SheetsInNewWorkbook = INT(1) loWorkBook = loExcel.WorkBooks.Add loExcel.Visible = .T. loSheet = loExcel.Sheets(1) loSheet.NAME = [MadFox] loSheet.Cells(1,1).Value = [Test] loSheet.Cells(1,2).Value = 3 loSheet.Cells(2,1).Value = [Test2] loSheet.Cells(2,2).Value = 8 lcRange = [A1:B2] loSheet.Range( lcRange ).Copy lcClip = _CLIPTEXT loExcel.CutCopyMode = .F. loSheet.Range("A5").Select *SET STEP ON _CLIPTEXT = lcClip losheet.Range("a5").PasteSpecial(-4104,-4142,0,1) RELEASE ALL *** Unfortunately, it does not produce the desired result as the pasted cells are NOT transposed. It appears there is an issue with how Excel and Foxpro use the copy buffer memory, and we can avoid the PasteSpecial property error if we load the clipboard with a plain Foxpro string. (Remember during our meeting trials every once in a while we got some text to paste into the worksheet, but it always happened after we had done some copy/paste in Foxpro, thus overwriting the clipboard.) By copying the cliptext to a variable and then reading it back, I seem to have circumvented the memory space issue. However, in the process we evidently loose whatever information Excel needs to perform the transposition and we end up with an exact copy of the original range. Leaving us in a Catch-22. Maybe Jim's idea of creating and executing an Excel macro is the way to go?? On another point, you'll notice that I used the literal values rather than the include file definitions because I could not locate a copy of excel9.h I had assumed that somewhere in the MS KB it would tell me where to download it, but not so. Google turned up references to using it, but not to obtaining it. Neither could I find it in my installation of VS.Net. How the hell does one get a copy? --stein Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI 53581 608.538.3820 |
Excel...l
Cliff S
This code runs no problemo... Output is as expected and no errors.
*** XTest.prg *** *** finish up from madfox 17 Feb 04 meeting *** SET STEP ON oX=CREATEOBJECT("excel.application") oX.Visible=.t. oX.Workbooks.Add(1) oX.range('a1').Value=1 oX.range('b1').Value=2 oX.Range('a4').Select oX.Range('a1:b1').Copy oX.Range('a4').PasteSpecial(-4104,-4142,.f.,.t.) WAIT WINDOW 'did it work...?' oX.activeworkbook.saved=.t. oX.application.quit * Walk In Beauty, cliff |
.Net Training
Eric Selje
I don?€?t know how far and wide our announcements go, but the Michigan user groups are once again sponsoring a full day training class in Lansing, MI. We began work on this before this discussion started, so we didn?€?t think to mention it to anyone outside the Michigan user groups. We are bringing in Kevin McNeish to conduct a class on .NET. The class will be Saturday, May 1, and the cost is $125 for user group members, $150 for others. If anyone wants more information, please let me know.
Mike Potjer GRAFUG President potjerm@... |
Re: Excel...l
Stein Goering
So the only thing needed to make our code of last night work was to change
toggle quoted message
Show quoted text
the Pastespecial params to logicals??? Yes, I tried it; it is true. Change that line to: loSheet.Range("a5").PasteSpecial(-4104,-4142,.F.,.T.) And it works. But I SWEAR we did that last night. That's what we started with. We only went to 0, 1 when the logicals didn't work. Didn't we? What was in that Coke? Or was it the cake? --stein Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI 53581 608.538.3820 -----Original Message-----
From: Cliff S [mailto:hawkridge@...] Sent: Wednesday, February 18, 2004 10:16 AM To: madfox_vfp@... Subject: [madfox_vfp] Excel...l This code runs no problemo... Output is as expected and no errors. *** XTest.prg *** *** finish up from madfox 17 Feb 04 meeting *** SET STEP ON oX=CREATEOBJECT("excel.application") oX.Visible=.t. oX.Workbooks.Add(1) oX.range('a1').Value=1 oX.range('b1').Value=2 oX.Range('a4').Select oX.Range('a1:b1').Copy oX.Range('a4').PasteSpecial(-4104,-4142,.f.,.t.) WAIT WINDOW 'did it work...?' oX.activeworkbook.saved=.t. oX.application.quit * Walk In Beauty, cliff Yahoo! Groups Links |
Re: VFP version issues
Stein Goering
¿ªÔÆÌåÓýThanks but that wasn¡¯t it.? I had run into the GROUP BY issue in previous upgrades to VFP 8, so had already added the SET ENGINEBEHAVIOR clause.? And the areas where the odd behavior showed up often did not even involve a SELECT stmt of any sort¡. ? --stein ? Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI? 53581 ? 608.538.3820 ? From:
Foxprotalk@... [mailto:Foxprotalk@...] I haven't used codemine in years.? But, the biggest gotcha in my vfp8 conversion of vfp7 apps had to do with SQL statements.? Namely -?GROUP BY clause has a requirement in VFP8 that all the columns have to be restated.? The quick way around this - and a quick suggestion to you is to include: ? SET ENGINEBEHAVIOR to 70? at the top of your app or ENGINEBEHAVIOR=70? in your config.fpw ? It's worth a try ? Peter ? madfox_vfp-unsubscribe@... ¡¤? Your use of Yahoo! Groups is subject to the . |
Re: Excel...l
hawkridge
I really believe we tried every which way for those params and nothing
toggle quoted message
Show quoted text
worked. I banged this little example out in two minutes no problem. I am much more likely to believe that PJ has done some things to his workstation to make us all look like beginners again. Actually, the energy in the cosmos must be WIERD. I was working REAL LATE at a client network tonight and all of a sudden the network just went bonkers. I was burning a CD across the wire and it just stopped for a minute, then the buffer filled up again, then it would stop. I went to look at the switches (2 10/100 switches and a 10/100 hub) and both switches were just banging every port, the hub was quiet. Only the print servers, file server, and my tech system were alive - I have no idea what was going on other than maybe there were aliens on the roof - maybe PJ has some aliens in the back room there too. Walk In Beauty, Cliff Smith hawkridge@... / 608 647-2366 -----Original Message-----
From: Stein Goering [mailto:sgoering@...] Sent: Wednesday, February 18, 2004 10:52 PM To: madfox_vfp@... Subject: RE: [madfox_vfp] Excel...l So the only thing needed to make our code of last night work was to change the Pastespecial params to logicals??? Yes, I tried it; it is true. Change that line to: loSheet.Range("a5").PasteSpecial(-4104,-4142,.F.,.T.) And it works. But I SWEAR we did that last night. That's what we started with. We only went to 0, 1 when the logicals didn't work. Didn't we? What was in that Coke? Or was it the cake? --stein Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI 53581 608.538.3820 -----Original Message----- From: Cliff S [mailto:hawkridge@...] Sent: Wednesday, February 18, 2004 10:16 AM To: madfox_vfp@... Subject: [madfox_vfp] Excel...l This code runs no problemo... Output is as expected and no errors. *** XTest.prg *** *** finish up from madfox 17 Feb 04 meeting *** SET STEP ON oX=CREATEOBJECT("excel.application") oX.Visible=.t. oX.Workbooks.Add(1) oX.range('a1').Value=1 oX.range('b1').Value=2 oX.Range('a4').Select oX.Range('a1:b1').Copy oX.Range('a4').PasteSpecial(-4104,-4142,.f.,.t.) WAIT WINDOW 'did it work...?' oX.activeworkbook.saved=.t. oX.application.quit * Walk In Beauty, cliff Yahoo! Groups Links Yahoo! Groups Links |
_screen.caption trick
Stein Goering
¿ªÔÆÌåÓýJim T, you mentioned that you had your system set up so that the current directory would be echoed in the VFP screen caption.? Is there associated code or config info that you could post? ? --stein ? Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI? 53581 ? 608.538.3820 ? ? |
Re: February Meeting
Stein Goering
As discussed in last meeting:
4. TextPad editor for Java programming. I noticed that this product was also featured in Jan 04 Foxpro Advisor tips section -- how to configure textpad to work with VFP. Having said that, my personal choice remains freeware editor PSPad. I still use integrated editor for VFP work, but have my system configured so PSPad replaces Notepad as default editor. --stein Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI 53581 608.538.3820 |
Re: February Meeting
¿ªÔÆÌåÓýStein:
?
Thanks for the tip.? I downloaded both and on initial use - agree that PSPad is better.? I'm doing some Java stuff and needed something more than NOTEPAD.? Thanks!
?
Peter D.
As discussed in last meeting: |
Re: _screen.caption trick
Jim Tooley
¿ªÔÆÌåÓýHi Stein,
?
I've been going over some code Eric showed us years
ago which I've just taken for granted because it's just been there... working
quietly in the background every time I start VPF.
?
Basically you need to issue:
?
_screen.caption=sys(5)+sys(2003) from the command
window or somewhere.
?
What I was remembering at the meeting was that this
line is in my config file at startup ... being there it only shows me were I am
at startup. I've been playing with MACROS under TOOLS on the toolbar.? I
set one up so that when I hit the F12 key it will refresh the _screen.caption
property. The code I entered in the Macro box is:
?
_screen.caption=sys(5)+sys(2003){Enter}
?
This of course mimicks CD? but at least you
know exactly where to look on the screen for the folder you are in.
?
If the macro were set up like
this:???
{Enter}_screen.caption=sys(5)+sys(2003){Enter}?? then you could use
the F12 key as an alternate "Enter" key and the screen.caption would be updated
everytime you did something in the command window.
?
It would be nice to suppress the output that goes
to the Command Window but the only properties that I can found for the Command
Window are found by right-clicking in it. There doesn't seem to be a lot of
controls to play with there.? Do you know how to did deeper into it? I
don't think we can just run a macro on the "ENTER" key.
?
Jim
?
?
|
Re: _screen.caption trick
hawkridge
¿ªÔÆÌåÓýSo
here is a partial solution.? This is what I put in the activate() of
my_projecthook class, cDefaultFilePath & oThisProject are custom
properties.? This sets the default file path and all the path search crap
for my standard project layout.? Also puts the info in the screen caption
(just added this after our meeting).
?
This
is only a partial solution as far as I can see as it does not refresh.? If
there were a way setting up an event whenever a project becomes active, then we
could readjust the paths and caption when more than one project is open at a
time.? Unfortunately, the docs say I can't bind to a method/property in
_VFP or we could do an update with BINDEVENTS().
?
?
* set default path to project home
directory each time the project is activated
* show the developer the path in the main screen titlebar ?
LOCAL cDefaultSearch
?
this.cDefaultFilePath =
_vfp.DefaultFilePath
this.oThisProject =
_vfp.ActiveProject
cDefaultSearch?= '.;.\data;.\lib;.\prg;.\include;.\forms;.\menus;.\reports;' + ; ????? 'd:\hawkridge\system\visual studio\vfp\my class libraries;' + ; ????? 'd:\hawkridge\system\visual studio\vfp\include' CD (this.cDefaultFilePath) SET DEFAULT TO (this.cDefaultFilePath) SET PATH TO (cDefaultSearch) _Screen.Caption = 'DEFAULT FILE PATH = ' +?this.cDefaultFilePath DODEFAULT() RETURN Soooo..... if anyone can figure out how to raise an
event whenever a project becomes active, then we could automate this, or maybe
hook the ActiveProject.Refresh().
Walk In Beauty, Cliff Smith |
Re: _screen.caption trick
PJ Fernandez
¿ªÔÆÌåÓýWhich
version are we talking here?? Because VFP 8.0 has that on the environment
option of the task pane.
?
P.J
|
Re: _screen.caption trick
Cliff S
¿ªÔÆÌåÓýSo I just looked at this and it is cool, but¡ it still doesn¡¯t dynamically change the environment.? What would be NICE is that clicking on a project window would automatically set the environment. ? -----Original
Message----- From: PJ Fernandez
[mailto:pjfern@...]
Sent: Wednesday, February 25, 2004 8:44 AM To: madfox_vfp@... Subject: RE: [madfox_vfp] _screen.caption trick ? Which version are we talking here?? Because VFP 8.0 has that on the environment option of the task pane. ? P.J -----Original
Message----- So here is a partial solution.? This is what I put in the activate() of my_projecthook class, cDefaultFilePath & oThisProject are custom properties.? This sets the default file path and all the path search crap for my standard project layout.? Also puts the info in the screen caption (just added this after our meeting). ? This is only a partial solution as far as I can see as it does not refresh.? If there were a way setting up an event whenever a project becomes active, then we could readjust the paths and caption when more than one project is open at a time.? Unfortunately, the docs say I can't bind to a method/property in _VFP or we could do an update with BINDEVENTS(). ? ? * set default path to
project home directory each time the project is activated ? LOCAL cDefaultSearch ? this.cDefaultFilePath = _vfp.DefaultFilePath this.oThisProject =
_vfp.ActiveProject Soooo..... if anyone can figure out how to raise an event whenever a project becomes active, then we could automate this, or maybe hook the ActiveProject.Refresh(). Walk In Beauty, Cliff Smith
|
Re: _screen.caption trick
Stein Goering
¿ªÔÆÌåÓýNeither can I see an option to display the default directory in the title bar, which was the original question¡. ? --stein ? Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI? 53581 ? 608.538.3820 ? From: Cliff S [mailto:hawkridge@...]
Sent: Wednesday, February 25, 2004 9:11 AM To: madfox_vfp@... Subject: RE: [madfox_vfp] _screen.caption trick ? So I just looked at this and it is cool, but¡ it still doesn¡¯t dynamically change the environment.? What would be NICE is that clicking on a project window would automatically set the environment. ? -----Original
Message----- ? Which version are we talking here?? Because VFP 8.0 has that on the environment option of the task pane. ? P.J -----Original
Message----- So here is a partial solution.? This is what I put in the activate() of my_projecthook class, cDefaultFilePath & oThisProject are custom properties.? This sets the default file path and all the path search crap for my standard project layout.? Also puts the info in the screen caption (just added this after our meeting). ? This is only a partial solution as far as I can see as it does not refresh.? If there were a way setting up an event whenever a project becomes active, then we could readjust the paths and caption when more than one project is open at a time.? Unfortunately, the docs say I can't bind to a method/property in _VFP or we could do an update with BINDEVENTS(). ? ? * set default path to
project home directory each time the project is activated ? LOCAL cDefaultSearch ? this.cDefaultFilePath = _vfp.DefaultFilePath this.oThisProject =
_vfp.ActiveProject Soooo..... if anyone can figure out how to raise an event whenever a project becomes active, then we could automate this, or maybe hook the ActiveProject.Refresh(). Walk In Beauty, Cliff
Smith
|
Re: _screen.caption trick
Cliff S
¿ªÔÆÌåÓýThe project hook code does that when the project is loaded, but it would be nice to do it when you switch between projects¡ ? cliff ? -----Original
Message----- From: Stein Goering
[mailto:sgoering@...]
Sent: Wednesday, February 25, 2004 9:31 AM To: madfox_vfp@... Subject: RE: [madfox_vfp] _screen.caption trick ? Neither can I see an option to display the default directory in the title bar, which was the original question¡. ? --stein ? Stein Goering Arbutus Computer Services 17494 Merry Hill Rd Richland Center, WI? 53581 ? 608.538.3820 ? From: Cliff S [mailto:hawkridge@...]
? So I just looked at this and it is cool, but¡ it still doesn¡¯t dynamically change the environment.? What would be NICE is that clicking on a project window would automatically set the environment. ? -----Original
Message----- ? Which version are we talking here?? Because VFP 8.0 has that on the environment option of the task pane. ? P.J -----Original
Message----- So here is a partial solution.? This is what I put in the activate() of my_projecthook class, cDefaultFilePath & oThisProject are custom properties.? This sets the default file path and all the path search crap for my standard project layout.? Also puts the info in the screen caption (just added this after our meeting). ? This is only a partial solution as far as I can see as it does not refresh.? If there were a way setting up an event whenever a project becomes active, then we could readjust the paths and caption when more than one project is open at a time.? Unfortunately, the docs say I can't bind to a method/property in _VFP or we could do an update with BINDEVENTS(). ? ? * set default path to
project home directory each time the project is activated ? LOCAL cDefaultSearch ? this.cDefaultFilePath = _vfp.DefaultFilePath this.oThisProject =
_vfp.ActiveProject Soooo..... if anyone can figure out how to raise an event whenever a project becomes active, then we could automate this, or maybe hook the ActiveProject.Refresh(). Walk In Beauty, Cliff
Smith ? ?
|