Typecast/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Typecast/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | La conversion de variables à plus faible amplitude vers des variables de plus forte amplitudes est faite automatiquement (implicite), de byte vers integer par exemple. | |
| 2 | + | ||
| 3 | + | Dans le sens inverse, la conversion d'une valeur d'un type vers un autre de plus faible amplitude demande un cast ou un appel de fonction, et si la valeur de départ ne s'ajuste pas dans le type de donnée cible alors de la donnée sera perdue.\ | |
| 4 | + | =Conversion de type=\ | |
| 5 | + | ||
| 6 | + | Type de donnée source | |
| 7 | + | ||
| 8 | + | Type de donnée cible | |
| 9 | + | ||
| 10 | + | Type de conversion | |
| 11 | + | ||
| 12 | + | Méthode | |
| 13 | + | ||
| 14 | + | Integer | |
| 15 | + | ||
| 16 | + | Real | |
| 17 | + | ||
| 18 | + | implicite | |
| 19 | + | ||
| 20 | + | instruction d'affectation | |
| 21 | + | ||
| 22 | + | Real | |
| 23 | + | ||
| 24 | + | Integer | |
| 25 | + | ||
| 26 | + | explicite:\ | |
| 27 | + | Perd la partie fractionnelle\ | |
| 28 | + | Arrondit la partie entière | |
| 29 | + | ||
| 30 | + | Trunc\ | |
| 31 | + | Round | |
| 32 | + | ||
| 33 | + | Integer | |
| 34 | + | ||
| 35 | + | String | |
| 36 | + | ||
| 37 | + | explicite | |
| 38 | + | ||
| 39 | + | IntToStr | |
| 40 | + | ||
| 41 | + | Real | |
| 42 | + | ||
| 43 | + | String | |
| 44 | + | ||
| 45 | + | explicite | |
| 46 | + | ||
| 47 | + | FloatToStr\ | |
| 48 | + | FloatToStrF | |
| 49 | + | ||
| 50 | + | String | |
| 51 | + | ||
| 52 | + | Integer | |
| 53 | + | ||
| 54 | + | explicite | |
| 55 | + | ||
| 56 | + | StrToInt | |
| 57 | + | ||
| 58 | + | String | |
| 59 | + | ||
| 60 | + | Real | |
| 61 | + | ||
| 62 | + | explicite | |
| 63 | + | ||
| 64 | + | StrToFloat | |
| 65 | + | ||
| 66 | + | String | |
| 67 | + | ||
| 68 | + | Char | |
| 69 | + | ||
| 70 | + | explicite | |
| 71 | + | ||
| 72 | + | String\[index\] | |
| 73 | + | ||
| 74 | + | Char/AnsiChar/WideChar | |
| 75 | + | ||
| 76 | + | String | |
| 77 | + | ||
| 78 | + | implicite | |
| 79 | + | ||
| 80 | + | instruction d'affectation | |
| 81 | + | ||
| 82 | + | Char/AnsiChar | |
| 83 | + | ||
| 84 | + | Byte | |
| 85 | + | ||
| 86 | + | explicite | |
| 87 | + | ||
| 88 | + | Ord\ | |
| 89 | + | Byte(valeur char) | |
| 90 | + | ||
| 91 | + | Byte | |
| 92 | + | ||
| 93 | + | Char/AnsiChar | |
| 94 | + | ||
| 95 | + | explicite | |
| 96 | + | ||
| 97 | + | Chr\ | |
| 98 | + | AnsiChar(valeur byte) | |
| 99 | + | ||
| 100 | + | Enuméré type | |
| 101 | + | ||
| 102 | + | String | |
| 103 | + | ||
| 104 | + | explicite | |
| 105 | + | ||
| 106 | + | WriteStr(string-var,enum-var) | |
| 107 | + | ||
| 108 | + | Type de donnée source | |
| 109 | + | ||
| 110 | + | Type de donnée cible | |
| 111 | + | ||
| 112 | + | Type de conversion | |
| 113 | + | ||
| 114 | + | Méthode | |
| 115 | + | ||
| 116 | + | QWord | |
| 117 | + | ||
| 118 | + | Byte | |
| 119 | + | ||
| 120 | + | explicite | |
| 121 | + | ||
| 122 | + | Byte(QWord) | |
| 123 | + | ||
| 124 | + | QWord | |
| 125 | + | ||
| 126 | + | Word | |
| 127 | + | ||
| 128 | + | explicite | |
| 129 | + | ||
| 130 | + | Word(QWord) | |
| 131 | + | ||
| 132 | + | QWord | |
| 133 | + | ||
| 134 | + | Cardinal | |
| 135 | + | ||
| 136 | + | explicite | |
| 137 | + | ||
| 138 | + | Cardinal(QWord) | |
| 139 | + | ||
| 140 | + | QWord | |
| 141 | + | ||
| 142 | + | Longword | |
| 143 | + | ||
| 144 | + | explicite | |
| 145 | + | ||
| 146 | + | Longword(QWord) | |
| 147 | + | ||
| 148 | + | Longword | |
| 149 | + | ||
| 150 | + | Byte | |
| 151 | + | ||
| 152 | + | explicite | |
| 153 | + | ||
| 154 | + | Byte(Longword) | |
| 155 | + | ||
| 156 | + | Longword | |
| 157 | + | ||
| 158 | + | Word | |
| 159 | + | ||
| 160 | + | explicite | |
| 161 | + | ||
| 162 | + | Word(Longword) | |
| 163 | + | ||
| 164 | + | Longword | |
| 165 | + | ||
| 166 | + | Cardinal | |
| 167 | + | ||
| 168 | + | implicite | |
| 169 | + | ||
| 170 | + | assignment statement | |
| 171 | + | ||
| 172 | + | Int64 | |
| 173 | + | ||
| 174 | + | Byte | |
| 175 | + | ||
| 176 | + | explicite | |
| 177 | + | ||
| 178 | + | Byte(Int64) | |
| 179 | + | ||
| 180 | + | Int64 | |
| 181 | + | ||
| 182 | + | Shortint | |
| 183 | + | ||
| 184 | + | explicite | |
| 185 | + | ||
| 186 | + | Shortint(Int64) | |
| 187 | + | ||
| 188 | + | Comp | |
| 189 | + | ||
| 190 | + | Byte | |
| 191 | + | ||
| 192 | + | explicite | |
| 193 | + | ||
| 194 | + | Byte(Comp) | |
| 195 | + | ||
| 196 | + | Comp | |
| 197 | + | ||
| 198 | + | Shortint | |
| 199 | + | ||
| 200 | + | explicite | |
| 201 | + | ||
| 202 | + | Shortint(Comp) | |
| 203 | + | ||
| 204 | + | Comp | |
| 205 | + | ||
| 206 | + | Real | |
| 207 | + | ||
| 208 | + | explicite | |
| 209 | + | ||
| 210 | + | Real(Comp) | |
| 211 | + | ||
| 212 | + | --- | |
| 213 | + | *From the Free Pascal wiki, page "Typecast/fr", as it stood on 2016-12-16 after a change by E-ric, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
