Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need suggestion for solution
Message
De
01/12/2004 15:22:51
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
À
01/12/2004 15:02:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00966168
Message ID:
00966179
Vues:
5
James,

How about a function call like:
FUNCTION MoveData
LPARAMETERS tuOldField, tuNewField, tuKey
LOCAL luOldData

luOldData = EVALUATE(tuOldField)

SEEK tuKey

REPLACE (tuNewField) WITH luOldData
Just select your table, set your index to the key field, locate the record with the data you want to copy, and call the function with 'Value1', 'Value2', 'ABCDB'.

Does that work?

>Jim --
>
>This is only an example of the type of problem I seem to be encountering in one application. The actual rules are more complex than this -- for instance, this won't be happening for all records, it's not always from site "C" to "B", etc. -- but I needn't get into that here.
>
>All I'm looking for is a code segment that will help with this very specific example, and I presume I'll be able to adapt it from there as needed.
>
>So, a solution which merely takes the value from site "C" and puts it into a different field in site "B" is all I'm looking for.
>
>>James,
>>
>>Do you also want to store value1 from site B to value 2 of Site A or are you just dealing with sites C and B? And what about value 1 of Site A - does that get stored to value 2 of Site D?
>>
>>Regards,
>>
>>>I have what I think should be a simple problem, but I don't see a solution. It's sort of like I want to
>>>
SET RELATION TO bla-bla IM MyTable INTO MyTable
>>>
>>>which of course makes no sense.
>>>
>>>It simplest terms, I have a cursor with four fields: Part, Site, Value1, and Value2. For each Part, I have four records, one for each Site. (The Sites are named "A", "B", "C", and "D".)
>>>
>>>What I'd like to do can be stated quite simply: For each Part, take Value1 for Site="C" and store it into Value2 for Site="B". Thus:
>>>
>>>
Part   Site    Value1   Value2
>>>
>>>ABC    A         11       88
>>>ABC    B        201      255
>>>ABC    C         77       66
>>>ABC    D        401      444
>>>
>>>Becomes
>>>
>>>
Part   Site    Value1   Value2
>>>
>>>ABC    A         11       88
>>>ABC    B        201    => 77 <=
>>>ABC    C         77       66
>>>ABC    D        401      444
>>>
Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform