Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 9 Jahren, 1 Monat
Letzter Beitrag:
vor 9 Jahren, 1 Monat
Beteiligte Autoren:
Ola, marcel.berman@managingbusiness.be.pcs, Stefan Bentvelsen

How to move around a "recordful" of data?

Startbeitrag von Ola am 31.03.2009 19:02

Hi all!

I would like to copy the active form's "screen record" to memory and then, if necessary, restore the copy back to "screen".

I've searched the help file back and forth many times, but could not find the appropriate command pair for these operations.

----------------------------------------------

Another, a little related situation:

With HRetrieveRecord I can copy a file buffer record to memory:

sRecordCopy is string = HRetrieveRecord(FILENAME)

But this works only partially, leaving binary memos and compost keys out, and there is no "HRestoreRecord" or equivalent command, or at least I could not find one.

---------------------------------------------
Now the question:

What would be the best way to copy a "recordful" of data between screen, memory and record buffer, without handling all the items separately, something like "ScreenToMemory", "MemoryToScreen" and "MemoryToFile", in the lines of the everyday workhorses FileToScreen and ScreenToFile?

Any hints, tips and sample codes will be appreciated!

Ola Pedersen
http://www.pienoismalli.com

Antworten:

Hi Ola,

if you make an alias of the file (but without HCreation, etc.) you can use that alias as buffer for a backup of your record. With HCopyRecord() to copy the record-data from your original file to the alias and vice versa.



von Stefan Bentvelsen - am 31.03.2009 19:52
Hi !
Concerning ScreenToMemory and MemoryFoScreen :
These functions exist in V14 (french names of the functions are
EcranVersSource and SourceVersEcran).
In order to use these functions, the possibility to bind a control to a
Structure or an object has been added to controls just like you can bind a
control to a field.
You can even bind a screen table to an array of objects !
I am using it and it is really a major enhancement !
So you just have to wait a little bit !

Regards !

--
Marcel Berman
Président de Be-Dev.be (www.be-dev.be) (Belgique)
Membre du CA de Wind'Asso (www.windasso.org) (France)
Be-Dev.be et Wind'Asso sont des associations d'utilisateurs des produits
PC-Soft
Message forwarded from pcsoft.us.windev

von marcel.berman@managingbusiness.be.pcs - am 01.04.2009 06:43
Thanks Stefan and Marcel!

Stefan,
I was aware of the alias + HCopyRecord, but somehow this feels to me like shooting a fly with a cannon. But thanks for pointing it out, I may have to use it.

Marcel,
This was good news. I look forward to getting ScreenToMemory and MemoryToScreen commands in version 14.

Similar kinds of commands for memoryfile moves, MemoryToFile and FileToMemory, exist already in version v. 11, and they also require the use of a structure or class variable to handle the memory side of the storage. Unfortunately there are no code samples in the on-line help on how to use these commands.

Can you - or anybody - give some sample on how to use a memory structure to hold a file buffer? Specifically, how can a file structure be built, without copying each item's properties separately to a structure? Ideally it would be something like:

CustomerStructure is a structure like Customer.Record

regards
Ola




von Ola - am 02.04.2009 18:04
Hi Ola,

on the moment I use a class to temporarily save any record in my apps. In that class I use HRecordToXML() to put the record data in a string. In that class I have u.a. functions to restore the saved record, to compare the saved record with the current record and to get a specific field from the saved record.

But: items whose types are composite key, binary, binary memo are ignored!


von Stefan Bentvelsen - am 03.04.2009 07:10
Hi !
It is very simple to build a class from the analysis ...
May be you don't know that WD can build UML schema from the analysis ...
and that WD can create classes from the UML schema ...
The nice thing is that once you have modfied one class, (added a method, or
a supplemental member) in the code, when you open the UML schema, WD ask you
if you want to bring the modification in the schema.
Also, if you change the UML schema, WD will propose to modify the class
accordingly ...
I do use this very regurlarly and it works fine ... BUT manage well your
backups ! If you change a class, and after, you modify the analysis, or the
contrary, without going through the UML schema, sometimes WD mess things and
you could find that you have loss things in your class ...
One thing that you should care off is that in the description of each UML
class, you have on option wich explain wich type of code will produced.
Because you can choose between OO or procedural code.
OO will produce a class with members corresponding to the fields of the
table
Procedural will produce a Procedure Collection containing only a structure
with members corresponding to the fields.
You can also specify this when creating the classes from the analysis.
But otherwise it works really well !
As I have only a French Version, I have some problems to give you the right
menu options to use but you could find these easely.
Hope this help !

--
Marcel Berman
Président de Be-Dev.be (www.be-dev.be) (Belgique)
Membre du CA de Wind'Asso (www.windasso.org) (France)
Be-Dev.be et Wind'Asso sont des associations d'utilisateurs des produits
PC-Soft
Message forwarded from pcsoft.us.windev

von marcel.berman@managingbusiness.be.pcs - am 03.04.2009 11:26
Thanks again guys,

It seems that I' ll have to start reading the UML documentation in the on-line help.

Best regards
Ola

von Ola - am 06.04.2009 11:45
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.