ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: C# et le WITH   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

lun. 23 juin 2008, 11h03
OlivierH
atoutfox.public.association

Re: C# et le WITH

greg,

Peux tu m'envoyer ton email

Olivier,



Gregory a écrit :
> Olivier,
>
> Il n'y a pas de with/endwith, par contre quand tu utilises le new, tu
> peux initialiser comme un si c'etait un tableau
>
> Exemple tableau
> int[] tab = new int[] {1,2,3};
>
> exemple avec une classe
>
> supposons
>
> public class Commande
> {
> public int No;
> public int Client;
> public List<LigneCommande> Lignes;
>
> }
> public class LigneCommande
> {
> public int Article;
> public int qty;
> }
>
> alors
> static void main()
> {
> var commande = new Commande
> {
> No = 123,
> Client = 456,
> Lignes = new List<LigneCommande>()
> {
> new LigneCommande { Article = 123, qty = 1},
> new LigneCommande { Article = 789, qty = 2}
> }
> };
> }
>
> Cela va te soulager un peu - j'espere
>
> Gregory
> _
> "OlivierH" <"nospam[contact]"@planitron.com> wrote in message
> news:g13hec$2sr$1@news.niouzes.net...
>> Et oui gregory,
>>
>> J'ai fait cela !
>>
>> dataRow DR = ds.tables[0].rows[0];
>>
>>
>> Et donc j'utilise DR
>> au lieu de With ds.tables(0).rows(0);
>>
>> Mais michel a bien raison, c'est un petit plus de VB,
>>
>> Enfin bon la methode par une variable TMP ca me va !
>>
>>
>> Olivier,
>>
>>
>> Gregory a écrit :
>>> Oui, Olivier, pas de with/endwith
>>>
>>> Mais on peut creer une variable tmp avec un nom court
>>>
>>> var x = UnObjetAvecUnNomTresLong;
>>> x.Name = "pp";
>>> x.... = ...;
>>>
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000002423
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3