Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPLACE command does not REPLACE....
Message
De
04/03/2008 13:22:11
 
 
À
04/03/2008 10:55:42
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01298436
Message ID:
01298523
Vues:
18
>Hi Matt
>
>I'm always telling people this. REPLACE alias.field with value is not the same as REPLACE field with value IN alias. The only time you need to prefix the field with the alias is if you're working with SET RELATION and replacing fields in both tables. If you're doing that, the alias prefix stands out. Otherwise you save typing. It's not just a matter of style. It's a matter of prevention.
>
>>Why did this code not work when trying to use the REPLACE command to replace a field in a different alias than the current alias?
>>
>> SELECT SomeTableOtherThanMachineSched
>> *-- Some misc code here
>> is it that REPLACE IS MISPELLED HERE??
>> REPALCE MachineSched.status with 'C' <------ (An updateable view)
>> llUpdate=TABLEUPDATE(1,.t.,'MachineSched')&& update local view
>> IF llupdate=.f.
>> MESSAGEBOX('Error updating changes to data table in cmdCheck.click()', 0, 'Error')
>> ENDIF
>>
>> *-- Requery local view
>> cMachNo=thisform.mach_num && Required var for local view
>> REQUERY('MachineSched') && to refresh data set
>>
>>
>>
>> Problem:
>>
>> The REPLACE with 'C' would not 'stick' until I specifically SELECTED the correct view alias first.
>>
>> This code did work:
>>
>> SELECT SomeTableOtherThanMachineSched
>> *-- Some misc code here
>>
>> SELECT MachineSched
>> REPLACE status with 'C' <------ (An updateable view)
>> llUpdate=TABLEUPDATE(1,.t.,'MachineSched')&& update local view
>> IF llupdate=.f.
>> MESSAGEBOX('Error updating changes to data table in cmdCheck.click()', 0, 'Error')
>> ENDIF
>>
>> *-- Requery local view
>> cMachNo=thisform.mach_num && Required var for local view
>> REQUERY('MachineSched') && to refresh data set
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform