Cousin Glen shared a way to put the weather on our form in his blog as well as in foxite last time and so when I decided that I finally needed one because we are working simultaneously on several road construction projects these days and the weather forecast will be helpful, I did not need to look far away and simply checked what he has shared which is via XMLHttpRequest.
What is XMLHttpRequest?
XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script. http://en.wikipedia.org/wiki/XMLHttpRequest
Using XMLHttpRequest has some (expected) peculiarities like it appears based on my observation that the previous request is compounding seeing my laptop which is doing the data fetching getting slower over time. Thus, I informed him of such and we decided to do these additional things:
This is dedicated in assisting others on developing and non-developing matters. It is also the official home of ssUltimate Library.
Friday, April 4, 2014
Wednesday, April 2, 2014
Combobox using RowSourceType = 3, How to update content?
Well I use this to answer inside foxite forum earlier but then I just thought maybe some does not know yet how to use a cursor from an SQL SELECT as RowSource of a combobox, or if some do, they are maybe wondering how to update such when there is a change from the source table/cursor, in result keeping them away over its usage on a combobox; so I transferred it over here as part of my simple tutorials.
You see, I prefer to work on cursors on my end as that makes my app works faster, less prone to corruption (possibility of corruption may happen only during transferring of data from cursor to actual table), and easier to maintain.
So I use cursors on grids, listbox, combobox, etc. However, some may have been wondering that if they use a cursor for a combobox RowSource, how to update said combobox then when there is a change in data from the actual table it is coming from? Or in other words, how to show the changes back to the combobox when it is already set to run on a cursor that was created earlier than when the change on the actual source table/cursor happened?
You see, I prefer to work on cursors on my end as that makes my app works faster, less prone to corruption (possibility of corruption may happen only during transferring of data from cursor to actual table), and easier to maintain.
So I use cursors on grids, listbox, combobox, etc. However, some may have been wondering that if they use a cursor for a combobox RowSource, how to update said combobox then when there is a change in data from the actual table it is coming from? Or in other words, how to show the changes back to the combobox when it is already set to run on a cursor that was created earlier than when the change on the actual source table/cursor happened?
Monday, March 31, 2014
Highlighting Pageframe ActivePage
Aesthetics is something that always fall to individual tastes. Some wanted their app to simply follow the OS theme, others want it to look plain, yet others like me wants to make it a bit colorful or somewhat unique thinking it will spice up the app.
However, sometimes we tend to overdo the look. For example, in the past I tend to create a pageframe with several pages each having its own colors (theme should be set to .F. otherwise the color will be ignored). In the first glance, things look cool to my taste but then in the end either I simply turn the theme back on because I get tired of the multitude of colors or I just retain one color for all pages with theme still set to .F.
However, sometimes we tend to overdo the look. For example, in the past I tend to create a pageframe with several pages each having its own colors (theme should be set to .F. otherwise the color will be ignored). In the first glance, things look cool to my taste but then in the end either I simply turn the theme back on because I get tired of the multitude of colors or I just retain one color for all pages with theme still set to .F.
Saturday, February 1, 2014
LOCATE vs SEEK, which is faster?
From time to time someone would inquire which is faster? LOCATE or SEEK? And the answer mostly is it depends, if the records are small, then the speed difference is negligible enough. True. But that does not still answer which really is faster. When we say faster, it has to be at least a nanosecond quicker than the other one. We are not arguing "how" fast but "which" is faster.
To understand better which is really faster, we have to first understand how the two differs. How does LOCATE performs searching? How does SEEK performs searching? Let us start with SEEK() first.
HOW DOES SEEK() PERFORM SEARCHING?
To understand better which is really faster, we have to first understand how the two differs. How does LOCATE performs searching? How does SEEK performs searching? Let us start with SEEK() first.
HOW DOES SEEK() PERFORM SEARCHING?
Thursday, January 30, 2014
Slow Connection? Sniff your way out!
This is actually mostly for IT personnel but is very useful as well for developers encountering slow connection on LAN. Speaking as both, one thing that we face most of the time is degradation of speed on the network and the problem is it can be anything such as wrong design in our app, faulty hardware like switches and lan cards, or a malware flooding the network causing heavy traffic.
As an IT Manager, what I do on my end, for lack of proper tools before, is to trace things manually. Sometimes with the help of IpSnooper tool I shared in foxite, weblogs and blogspot, I was able to pinpoint which machine a specific IP Address belongs to. But that is if you will be able to trace which IP is flooding the network.
For some cases, like I said, I have to do it manually (with my IT guys' assistance) by observing the speed of the network or even internet access by unplugging one by one (and reconnecting back) each connection on our switch. And I was able to trace the units causing the flooding that way. But...... that is the hard way.
As an IT Manager, what I do on my end, for lack of proper tools before, is to trace things manually. Sometimes with the help of IpSnooper tool I shared in foxite, weblogs and blogspot, I was able to pinpoint which machine a specific IP Address belongs to. But that is if you will be able to trace which IP is flooding the network.
For some cases, like I said, I have to do it manually (with my IT guys' assistance) by observing the speed of the network or even internet access by unplugging one by one (and reconnecting back) each connection on our switch. And I was able to trace the units causing the flooding that way. But...... that is the hard way.
Monday, January 6, 2014
Printer Environment on Report, when to save and when not to!
In earlier versions of VFP (before 9), Printer Environment is by default saved onto the report itself. But then there are cases where because of that, when our app is installed on a client's machine and that machine has a different printer than what we have when we design the report and compiled the app into exe, the report output on the client machine may generate a much different output than what we are expecting like difference on dimensions, margins, font sizes, spaces, some portion cut-off, etc. And the solution to those problems is to hack into the FRX and clear out these printer environment from within so it will be free of the settings of a "specific" printer.
For these reasons, in VFP9, VFP team saw the need to reverse the process by not saving printer environment anymore within the report. They made it optional by adding a checkbox in Page Setup of a report that allows us to save or not printer environment. And by reverse, I mean the default now is it is no longer saved.
Question is, if saving printer environment results to unwanted outputs that has often led developers in lower versions of VFP to always hack the frx files, why should we tick it then? Why is this option still given to us? Why not simply remove this feature? Is there still any use for this?
For these reasons, in VFP9, VFP team saw the need to reverse the process by not saving printer environment anymore within the report. They made it optional by adding a checkbox in Page Setup of a report that allows us to save or not printer environment. And by reverse, I mean the default now is it is no longer saved.
Question is, if saving printer environment results to unwanted outputs that has often led developers in lower versions of VFP to always hack the frx files, why should we tick it then? Why is this option still given to us? Why not simply remove this feature? Is there still any use for this?
Wednesday, September 11, 2013
Grid Dynamics' Power!!!
What is Dynamic?
Adjective
(of a process or system) Characterized by constant change, activity, or progress.
Noun
A force that stimulates change or progress within a system or process.
So Dynamic can change. It is the opposite of being Static or Fixed.
In VFP Grid, there is only one real row and the rest are just mirrors of the first one manipulated by VFP to show different values. It means that conditions on objects (textbox, combobox, checkbox, etc) on a column are static. What condition and formatting you applied to an object of a cell applies to the rest of the cells belonging to that column.
But since there definitely is a need for us to reflect on a cell certain values based on several conditions, then that is where Dynamic Properties of a grid is needed (see VFP help on available Dynamic Properties). A very powerful feature of grid that makes me prefer it over to listbox.
Yesterday inside Foxite, I finally understood the need of a fellow member with the sample he provided which is allowing a combobox inside a column to change values or sort of being filtered based on a combination of values of two fields (or column1 and Column5). And I showed him how to attain that by employing DynamicCurrentControl Property of the grid.
What is DynamicCurrentControl?
Please just refer to my early posting in Weblogs about this: http://weblogs.foxite.com/sandstorm36/2008/08/09/placing-various-images-on-a-grid/
Adjective
(of a process or system) Characterized by constant change, activity, or progress.
Noun
A force that stimulates change or progress within a system or process.
So Dynamic can change. It is the opposite of being Static or Fixed.
In VFP Grid, there is only one real row and the rest are just mirrors of the first one manipulated by VFP to show different values. It means that conditions on objects (textbox, combobox, checkbox, etc) on a column are static. What condition and formatting you applied to an object of a cell applies to the rest of the cells belonging to that column.
But since there definitely is a need for us to reflect on a cell certain values based on several conditions, then that is where Dynamic Properties of a grid is needed (see VFP help on available Dynamic Properties). A very powerful feature of grid that makes me prefer it over to listbox.
Yesterday inside Foxite, I finally understood the need of a fellow member with the sample he provided which is allowing a combobox inside a column to change values or sort of being filtered based on a combination of values of two fields (or column1 and Column5). And I showed him how to attain that by employing DynamicCurrentControl Property of the grid.
What is DynamicCurrentControl?
Please just refer to my early posting in Weblogs about this: http://weblogs.foxite.com/sandstorm36/2008/08/09/placing-various-images-on-a-grid/
Subscribe to:
Posts (Atom)