Archive for April, 2005

Backspace in VFP

Posted on April 25, 2005. Filed under: Visual FoxPro |

Thanks to Amit for alerting me to the fact that my backspace solution didn’t work for the mouse event.

Turns out that the solution is still simple but involves using KeyPress aswell as Valid.

Simply add a new property (eg bAllowBackspace) to your textbox baseclass and then throw the follow code in KeyPress and Valid events

KeyPress()

LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 127 AND
This.SelStart

Advertisements
Read Full Post | Make a Comment ( None so far )

CodeCampOz

Posted on April 25, 2005. Filed under: Visual FoxPro |

Updated: I had the wrong MSDN link – fixed now

I write this from CodeCampOz which has been a fantastic event. For a ‘free’ event it has been remarkably smooth and well organised. (The event itself is free, you only have to get and stay here (Wagga) so travel and accomodation is the only cost.)

The weekend has focussed on Visual Studio 2005 Beta 2 (released just a few days ago and given to everyone on arrival – excellent touch guys, with thanks to Andrew Coates I believe) with some other sessions on SQL 2005 and BizTalk Server.

I consider this a mini-TechEd whereby you can get a look at the upcoming features of Microsoft products by some of the leading Australian developers. It should be on everyone developer’s agenda in order to keep up to date with what is happening in the land of Microsoft.
It has been thought provoking in both good and not so good ways (I’ll cover the not so good in a separate blog – they are nothing to do with the event by the way).

When it comes to presenters, most were very good, the standouts in my opinion being Greg Low, Adam Cogan and Joel Pobar. In the latter case, here’s a guy who is super smart, and passionate about his technology (the CLR in his case). I found him inspiring.

On another tack, I find it harder and harder to investigate new (even current) technology, so an event like this is a forced few days to forget about all the day-to-day stuff that consumes all our time and consider future development.

For us it will be to look into using SQL 2005 and ASP.Net 2.0 as soon as possible, and to delve into the compact framework as we are getting more and more requests for mobile device solutions these days. Desktop development in .Net still doesn’t have me excited (yes, I know I’ve got a VFP bias, but seriously, why would I move?) and I find this puzzling: I thought by now I would be seriously considering a move…

Greg and Mitch are to be highly commended for having both the intiative and organisational skills to make this event happen so smoothly. They pointed to the help of CSU and Microsoft so a big thankyou to those guys too. One thing I really admired about Greg and Mitch is that they got stuck into presenting aswell. I know how hard it can be organising events, so hard in fact that you have little time to do anything else. Kudos to them for presenting excellent sessions aswell.

So, congratulations Greg and Mitch, see you again next year. (Actually I’ll see Greg on Wednesday at the MSDN event in Sydney – if you aren’t already going people, you should consider it just to see Greg in action).

Read Full Post | Make a Comment ( None so far )

Backspace in VFP

Posted on April 25, 2005. Filed under: Visual FoxPro |

Thanks to Amit for alerting me to the fact that my backspace solution didn’t work for the mouse event.

Turns out that the solution is still simple but involves using KeyPress aswell as Valid.

Simply add a new property (eg bAllowBackspace) to your textbox baseclass and then throw the follow code in KeyPress and Valid events

KeyPress()

LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 127 AND
This.SelStart < 1
This.bAllowBackspace = .F.
ENDIF

* other code etc

Valid()

IF This.bAllowBackspace = .F.
This.bAllowBackspace = .T.
RETURN .F.
ENDIF

* other code etc

Read Full Post | Make a Comment ( 2 so far )

CodeCampOz

Posted on April 25, 2005. Filed under: Visual FoxPro |

Updated: I had the wrong MSDN link – fixed now

I write this from CodeCampOz which has been a fantastic event. For a ‘free’ event it has been remarkably smooth and well organised. (The event itself is free, you only have to get and stay here (Wagga) so travel and accomodation is the only cost.)

The weekend has focussed on Visual Studio 2005 Beta 2 (released just a few days ago and given to everyone on arrival – excellent touch guys, with thanks to Andrew Coates I believe) with some other sessions on SQL 2005 and BizTalk Server.

I consider this a mini-TechEd whereby you can get a look at the upcoming features of Microsoft products by some of the leading Australian developers. It should be on everyone developer’s agenda in order to keep up to date with what is happening in the land of Microsoft.
It has been thought provoking in both good and not so good ways (I’ll cover the not so good in a separate blog – they are nothing to do with the event by the way).

When it comes to presenters, most were very good, the standouts in my opinion being Greg Low, Adam Cogan and Joel Pobar. In the latter case, here’s a guy who is super smart, and passionate about his technology (the CLR in his case). I found him inspiring.

On another tack, I find it harder and harder to investigate new (even current) technology, so an event like this is a forced few days to forget about all the day-to-day stuff that consumes all our time and consider future development.

For us it will be to look into using SQL 2005 and ASP.Net 2.0 as soon as possible, and to delve into the compact framework as we are getting more and more requests for mobile device solutions these days. Desktop development in .Net still doesn’t have me excited (yes, I know I’ve got a VFP bias, but seriously, why would I move?) and I find this puzzling: I thought by now I would be seriously considering a move…

Greg and Mitch are to be highly commended for having both the intiative and organisational skills to make this event happen so smoothly. They pointed to the help of CSU and Microsoft so a big thankyou to those guys too. One thing I really admired about Greg and Mitch is that they got stuck into presenting aswell. I know how hard it can be organising events, so hard in fact that you have little time to do anything else. Kudos to them for presenting excellent sessions aswell.

So, congratulations Greg and Mitch, see you again next year. (Actually I’ll see Greg on Wednesday at the MSDN event in Sydney – if you aren’t already going people, you should consider it just to see Greg in action).

Read Full Post | Make a Comment ( None so far )

Do not fill out the VFP survey!

Posted on April 6, 2005. Filed under: Visual FoxPro |

Did you know that Microsoft are conducting a big survey about VFP?

It only takes about 3 minutes and you go into the draw to win a ticket to Devcon or a cassh prize. Too easy.
But the less people who fill out the survey, the less entrants in the draw and thus the better my chances of winning.

So I encourage you to ignore the great help this will be to the product and how it will enable Microsoft to better serve your development needs and the needs of the developer community in general, and help me to win.

Please do not go to this link:
http://www.researchhq.com/softdev/default.asp?name=site4

I thank you in advance.

Read Full Post | Make a Comment ( None so far )

Do not fill out the VFP survey!

Posted on April 6, 2005. Filed under: Visual FoxPro |

Did you know that Microsoft are conducting a big survey about VFP?

It only takes about 3 minutes and you go into the draw to win a ticket to Devcon or a cassh prize. Too easy.
But the less people who fill out the survey, the less entrants in the draw and thus the better my chances of winning.

So I encourage you to ignore the great help this will be to the product and how it will enable Microsoft to better serve your development needs and the needs of the developer community in general, and help me to win.

Please do not go to this link:
http://www.researchhq.com/softdev/default.asp?name=site4

I thank you in advance.

Read Full Post | Make a Comment ( None so far )

INSERT into a view on joined tables in VFP

Posted on April 4, 2005. Filed under: Visual FoxPro |

You can insert and delete records on a view that is a join of two tables.

Not sure why I thought you couldn’t do this but I got myself confused over views. I thought you could only insert into views on a single table.
But you definately can insert and delete on joined tables. In my case its on a 1:1 join. I need to investigate if this is the case with 1:M tables too…

Read Full Post | Make a Comment ( None so far )

Stop backspace in VFP

Posted on April 4, 2005. Filed under: Visual FoxPro |

Here’s a tip Scott Scovell informed me of regarding a non-standard VFP behaviour:

‘I had a request from a client to prevent the textbox from losing the focus when they use BACKSPACE.

When removing details from a textbox using the BACKSPACE key, focus was being transferred to the previous textbox and they (more often then not) began to remove details from that textbox as well.

Windows standard

The standard behaviour appears to be that when using BACKSPACE, focus is not transferred to the previous control in the tab order. Try this creating a New email in Outlook and setting focus to the CC field. Using BACKSPACE observe that the control does not lose focus. FoxPro does lose focus and the previous control in the tab order get focus.

Solution

Surprising easy. In the Valid, test for LastKey() = BACKSPACE and This.Value is Empty() then return false (deny lose focus)

* Deny loss of focus when the backspace key is pressed and the control has an empty value
If Lastkey() = 127 And Empty(This.Value)
Return .F.
EndIf

* other checks etc…
Return .T.

Read Full Post | Make a Comment ( 1 so far )

Binding to VFP9 System events

Posted on April 4, 2005. Filed under: Visual FoxPro |

Here’s a link to Scott Scovell’s whitepaper and code from the Sydney VFP UG last week
http://www.svfpug.com.au/assets/2005Mar/Scott%20Scovell%20-%20Binding%20to%20Windows%20Message%20events.zip

Scott is our Chief Software Architect at Talman

See also the UG site
www.svfpug.com.au

Read Full Post | Make a Comment ( None so far )

INSERT into a view on joined tables in VFP

Posted on April 4, 2005. Filed under: Visual FoxPro |

You can insert and delete records on a view that is a join of two tables.

Not sure why I thought you couldn’t do this but I got myself confused over views. I thought you could only insert into views on a single table.
But you definately can insert and delete on joined tables. In my case its on a 1:1 join. I need to investigate if this is the case with 1:M tables too…

Read Full Post | Make a Comment ( None so far )

Stop backspace in VFP

Posted on April 4, 2005. Filed under: Visual FoxPro |

Here’s a tip Scott Scovell informed me of regarding a non-standard VFP behaviour:

‘I had a request from a client to prevent the textbox from losing the focus when they use BACKSPACE.

When removing details from a textbox using the BACKSPACE key, focus was being transferred to the previous textbox and they (more often then not) began to remove details from that textbox as well.

Windows standard

The standard behaviour appears to be that when using BACKSPACE, focus is not transferred to the previous control in the tab order. Try this creating a New email in Outlook and setting focus to the CC field. Using BACKSPACE observe that the control does not lose focus. FoxPro does lose focus and the previous control in the tab order get focus.

Solution

Surprising easy. In the Valid, test for LastKey() = BACKSPACE and This.Value is Empty() then return false (deny lose focus)

* Deny loss of focus when the backspace key is pressed and the control has an empty value
If Lastkey() = 127 And Empty(This.Value)
Return .F.
EndIf

* other checks etc…
Return .T.


Read Full Post | Make a Comment ( 1 so far )

Binding to VFP9 System events

Posted on April 4, 2005. Filed under: Visual FoxPro |

Here’s a link to Scott Scovell’s whitepaper and code from the Sydney VFP UG last week
http://www.svfpug.com.au/assets/2005Mar/Scott%20Scovell%20-%20Binding%20to%20Windows%20Message%20events.zip

Scott is our Chief Software Architect at Talman

See also the UG site
www.svfpug.com.au

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...