« FindObject (role) » : différence entre les versions
(Page créée avec « {{latest}} <source lang='delphi'>function FindObject(const iExpression:string; const iOrderBy:string; iArgs:Array of variant):Integer;</source> Cette fonction retourne le... ») |
Aucun résumé des modifications |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 1 : | Ligne 1 : | ||
{{ | {{Version710}} | ||
<source lang='delphi'>function FindObject(const iExpression:string; const iOrderBy:string; iArgs:Array of variant):Integer;</source> | <source lang='delphi'>function FindObject(const iExpression:string; const iOrderBy:string; iArgs:Array of variant):Integer;</source> | ||
Ligne 23 : | Ligne 23 : | ||
Exemple | Exemple | ||
<source lang='delphi'> | <source lang='delphi'> | ||
//Procedure TestRoleFind; | |||
var instX:WFClasseX; instXX:WFClasseXX; ls:WFClasseXXList; ctn,indx:Integer; | |||
begin | |||
// WFClasseX has a role list of WFClasseXX | |||
// | |||
instX := WFClasseX.Find('','',true,[]); | |||
if not Assigned(instx) then Exit; | |||
// FindObject on a role list, return the object with the lower amount in the 40..50 range | |||
instXX := instX.WFClasseXXList.FindObject('(montant.value>%1) and (montant.value<%2)','montant',[40.00,50.00]); | |||
if Assigned(instXX) | |||
then ShowMessage(Format('Min amount:%02f',[instXX.montant.value])) | |||
else ShowMessage('Role.FindObject not found'); | |||
// FindObject on a role list, return the object with the higher amount in the 40..50 range | |||
instXX := instX.WFClasseXXList.FindObject('(montant.value>%1) and (montant.value<%2)','-montant',[40.00,50.00]); | |||
if Assigned(instXX) | |||
then ShowMessage(Format('Max amount:%02f',[instXX.montant.value])) | |||
else ShowMessage('Role.FindObject not found'); | |||
end; | |||
</source> | </source> | ||
Ligne 30 : | Ligne 51 : | ||
{{Footer|Rôles (tech)}} | {{Footer|Rôles (tech)}} | ||
[[category:Rôles (tech)]] | [[category:Rôles (tech)]] | ||
[[Category: | [[Category:Version710]] |
Dernière version du 30 mai 2016 à 12:05
{{#images:version710-32x32.png|stock}} <source lang='delphi'>function FindObject(const iExpression:string; const iOrderBy:string; iArgs:Array of variant):Integer;</source>
Cette fonction retourne le premier objet du rôle vérifiant l'expression suivant l'ordre de tri
Result | Index du premier objet retrouvé |
iExpression | Expression logique |
iOrderBy | Ordre de tri |
iArgs | Argument de l'expression |
Exemple <source lang='delphi'>
//Procedure TestRoleFind; var instX:WFClasseX; instXX:WFClasseXX; ls:WFClasseXXList; ctn,indx:Integer; begin
// WFClasseX has a role list of WFClasseXX // instX := WFClasseX.Find(,,true,[]); if not Assigned(instx) then Exit;
// FindObject on a role list, return the object with the lower amount in the 40..50 range instXX := instX.WFClasseXXList.FindObject('(montant.value>%1) and (montant.value<%2)','montant',[40.00,50.00]); if Assigned(instXX) then ShowMessage(Format('Min amount:%02f',[instXX.montant.value])) else ShowMessage('Role.FindObject not found');
// FindObject on a role list, return the object with the higher amount in the 40..50 range instXX := instX.WFClasseXXList.FindObject('(montant.value>%1) and (montant.value<%2)','-montant',[40.00,50.00]); if Assigned(instXX) then ShowMessage(Format('Max amount:%02f',[instXX.montant.value])) else ShowMessage('Role.FindObject not found');
end;
</source>
Voir aussi
{{#if:Rôles (tech)|
{{#if:Rôles (tech)|— Rôles (tech) |}} — Développement DSM —
|
{{#if:|— [[{{{1}}}]] |}} — Développement DSM —
}}