Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function to return what VFP will do to my code?
Message
From
14/01/2019 10:26:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/01/2019 09:33:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
CodeMine
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01664494
Message ID:
01665381
Views:
47
>>>Either use the SAFE SELECT technique,
>>>query to a second cursor
>>>then zap your grid's cursor
>>>append into the grid's cursor from the second cursor
>>>
>>
>>"SAFE SELECT" - a phrase that makes me smile whenever I see it :) Since there is a "SAFE" select, there should be the "UNSAFE" version of it? If so, what is that? I always thought selecting was safe.
>>
>>The process you describe for "SAFE" in the above is actually done simpler and I never thought to call it "SAFE":
>
>It should be called "grid-safe".
>
>>-(Save grid recordsource) and set it no null or empty string
>>-Query into that recordsource cursor or any other cursor you like
>>-Restore the recordsource
>
>There are other advantages to it, though - you don't have to do anything to your grid, so the code refilling your cursor can be isolated away and totally unaware of grid's existence. And you can also do appends from aliases with not exactly the same structure - append has this advantage that the number of columns doesn't have to match, there may be columns with different names, it will take only those that match and leave others blank.
>
>BTW, I hate the expression "safe select" for a different reason: it was invented by perhaps fifteen people around the fox world at the time, but the first ones to publish it in a magazine took the laurels as if only they invented it, and then advertised the article for years.

Actually I can't say I remember those days, because I didn't have any internet then, but I myself was doing the same thing (grid reconstruction was a problem to us all:). Then I noticed (or read somewhere) it was simpler just to set recordsource to an empty string. It is just another way, not that is SAFE and others are UNSAFE.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform