Pages traduites Pages à traduire Pages en cours de traduction
A propos
 

Différences

Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.

ags33 16/11/2008 00:44 ags33 27/04/2011 12:02 version actuelle
Ligne 2: Ligne 2:
---- ----
-====Upgrading to AGS 2.71==== +====Migrer vers AGS 2.71==== 
-AGS 2.71 adds new simple string support to the scripting language. Strings have long +AGS 2.71 ajoute un support simple des chaînes de caractères dans le langage de script. Les chaînes ont longtemps 
-been a pain to use in AGS, but this is finally addressed by v2.71.\\ \\  +été pénibles à utiliser dans AGS, mais ce problème est finalement résolu avec la version 2.71.\\ \\  
-There's a new String type (that's a capital 'S'). These new strings behave like Java/C# +Il existe un nouveau type String (avec un '//S//' majuscule). Ces nouvelles chaînes se comportent comme 
-strings in that you can easily assign to and manipulate them.\\ \\  +les chaînes en Java/C# en cela que vous pouvez facilement les manipuler et leur donner des valeurs.\\ \\  
-For example, in 2.7 and previous versions, you had to do this:  +Par exemple, dans les versions 2.7 et précédentes, vous deviez faire comme cela :
- +
   
-  string text+  string texte
-  StrCopy(text, "This is my text");+  StrCopy(texte, "Voici mon texte");
-in 2.71, you can now do:+avec la version 2.71, vous pouvez maintenant faire :
   
-  String text = "This is my text";+  String texte = "Voici mon texte";
-Furthermore, the == and != operators can be used to compare strings for equality (equivalent +De plus, les opérateurs == et != peuvent être utilisés pour comparer l'égalité des chaînes 
-to using StrComp but much more intuitive). An additional benefit is that there is no longer +(équivaut à utiliser StrComp mais bien plus intuitif). Un intérêt supplémentaire est qu'il n'est 
-a need for GetText() and SetText() methods -- instead, we can now just have Text properties.\\ \\  +plus nécessaire d'utiliser GetText() et SetText() -- à la place, vous pouvez simplement utiliser la propriété Text.\\ \\  
-All the old-style functions that took a "string buffer" parameter have now been replaced with +Toutes les anciennes fonctions qui prenaient un paramètre "tampon de chaîne" ("//string buffer//") ont désormais 
-new ones that return a string instead. Where properties have been created, you should be able +été remplacées par de nouvelles qui retournent une chaîne. Les propriétés des chaînes peuvent 
-to use them like any other property, so:+s'utiliser comme n'importe quelle propriété. Ainsi :
   
-  lblLabel.Text = "Hello";+  lblLabel.Text = "Salut";
  String buttonValue = btnOK.Text;   String buttonValue = btnOK.Text;
-and so on.\\ \\  +ou autre.\\ \\  
- ** NOTE: **  Some of the new functions are provided on the Game object -- for example, the new + ** NOTE : **  Certaines des nouvelles fonctions ont été implémentées dans les objets Game -- par exemple
-GetSaveSlotDescription function needs to be called like this:+la nouvelle fonction GameSaveSlotDescription doit être appelée ainsi :
  String description = Game.GetSaveSlotDescription(10);   String description = Game.GetSaveSlotDescription(10);
-This is part of a move towards all built-in functions being object-based, but watch out for it +Ceci fait partie d'une migration générale vers des fonctions orientées objet, mais méfiez vous 
-as it could well cause some confusion. The manual will show you which functions require this.\\ \\  +des confusions possibles. Le manuel vous renseignera sur les fonctions qui le requièrent.\\ \\  
-Rather than using old functions like StrCat and StrContains, you now call the functions +Plutôt qu'utiliser les vieilles fonctions comme StrCat et StrContains, vous pouvez maintenant appeler 
-directly on the strings:+les fonctions directement sur les chaînes :
   
-  String text = "Hello"; +  String texte = "Salut"; 
-  text = text.Append("World");+  texte = texte.Append(" tout le monde");
-will mean that // text //  now contains "HelloWorld". +signifie que // texte //  contient désormais "Salut tout le monde".
-Note the  ** text = ** in that expression. Functions like Append will return a modified version +Notez ** texte = ** dans cette expression. Les fonctions comme Append retourneront une version modifiée 
-of the string, they won't actually change the original. Therefore, to update the  // text //  +de la chaîne, elles ne changeront pas véritablement l'originale. Ainsi, pour mettre à jour la variable 
-variable you need to assign the result to it.\\ \\  +//texte// vous devez lui assigner le résultat.\\ \\  
- ** Backwards compatibility ** \\ \\  + ** Rétro-compatibilité ** \\ \\  
-In order to maintain backwards compatibility, a new "const" keyword has been added. This +Afin de maintenir la rétro-compatibilité, un nouveau mot-clé "const" a été ajouté. Celui-ci s'applique 
-applies only to old-style strings, and allows them to interoperate with the new ones. A +seulement aux vieilles chaînes, et vous permet de les incorporer aux nouvelles. Le nouveau type de chaînes (//**S**tring//) 
-new-style String can be passed to a function that expects a "const string" (which means +peut être passé aux fonctions qui attendent une ancienne chaîne constante ("//const string//") (ce qui signifie 
-that it will not be allowed to change the string's contents), but cannot be passed to a +qu'il ne sera pas permis de changer le contenu de la chaîne), mais ne peuvent pas être passées à une fonction 
-function that expects a "string" (since it could overwrite the string data and mess things up).\\ \\  +qui attend une chaîne (//**s**tring//) simple (puisque son contenu peut être modifié par la fonction).\\ \\  
-So, you may find that any custom functions you have that take a string parameter stop  +Les fonctions personnelles que vous aviez définies et qui prenaient une chaîne comme paramètres ne fonctionneront 
-working. If this is the case, change the parameter from "string" to "const string" and +donc peut-être plus. Si c'est le cas, changez l'ancien paramètre "string" pour "const string" et le problème 
-that should fix it.\\ \\  +devrait être résolu.\\ \\  
-Apologies for the inconvenience, but this is the only way to allow new Strings to +Toutes mes excuses pour le désagrément, mais c'est le seul moyen de permettre aux nouvelles chaînes 
-interoperate safely with old-style strings.+d'interagir sans soucis avec les anciennes.
-{{tag>anglais}}+{{tag>français}}
 
ags33.txt · Dernière modification: 27/04/2011 12:02 par kitai
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki