1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
|
{* ******************** CACHE-TEST ******************** *}
{%region CACHE-TEST}
{%region TYPE}
{$IFDEF Global_Type}
TCacheTestType = class
public
CTVal: Integer;
end;
{$ENDIF}
{$IFDEF Sub_FooFunc_LocalType}
TCacheTest = record
CTVal: Integer;
end;
{$ENDIF}
{$IFDEF FooFunc_LocalType}
TCacheTest = TCacheTestType;
{$ENDIF}
{%endregion TYPE}
{%region VARIABLES}
{$IFDEF Sub_FooFunc_LocalVar}
VarCacheTest1: TCacheTest; // record
VarCacheTest2: Integer;
{$ENDIF}
{$IFDEF FooFunc_LocalVar}
VarCacheTest1: TCacheTest; // class
VarCacheTest2: Integer;
{$ENDIF}
{%endregion VARIABLES}
{%region CODE (initilization)}
{$IFDEF Sub_FooFunc_Body}
VarCacheTest1.CTVal := 101;
VarCacheTest2 := 102;
{$ENDIF}
{$IFDEF FooFunc_Body}
VarCacheTest1 := TCacheTest.Create;
VarCacheTest1.CTVal := 201;
VarCacheTest2 := 202;
{$ENDIF}
{%endregion CODE (initilization)}
{%endregion CACHE-TEST}
{* ******************** -- ******************** *}
{%region FooFunc}
{$IFDEF FooFunc_Param}
//procedure FooFunc(
ArgByte: Byte; var VArgByte: Byte;
ArgWord: Word; var VArgWord: Word;
ArgLongWord: LongWord; var VArgLongWord: LongWord;
ArgQWord: QWord; var VArgQWord: QWord;
ArgShortInt: ShortInt; var VArgShortInt: ShortInt;
ArgSmallInt: SmallInt; var VArgSmallInt: SmallInt;
ArgInt: Integer; var VArgInt: Integer;
ArgInt64: Int64; var VArgInt64: Int64;
ArgPByte: PByte; var VArgPByte: PByte;
ArgPWord: PWord; var VArgPWord: PWord;
ArgPLongWord: PLongWord; var VArgPLongWord: PLongWord;
ArgPQWord: PQWord; var VArgPQWord: PQWord;
ArgPShortInt: PShortInt; var VArgPShortInt: PShortInt;
ArgPSmallInt: PSmallInt; var VArgPSmallInt: PSmallInt;
ArgPInt: PInteger; var VArgPInt: PInteger;
ArgPInt64: PInt64; var VArgPInt64: PInt64;
ArgPointer: Pointer; var VArgPointer: Pointer;
ArgPPointer: PPointer; var VArgPPointer: PPointer;
ArgDouble: Double; var VArgDouble: Double;
ArgExtended: Extended; var VArgExtended: Extended;
{$ENDIF}
{$IFDEF FooFunc_LocalVar}
//var
VarByte: Byte;
VarWord: Word;
VarLongWord: LongWord;
VarQWord: QWord;
VarShortInt: ShortInt;
varSmallInt: SmallInt;
VarInt: Integer;
VarInt64: Int64;
VarPByte: PByte;
VarPWord: PWord;
VarPLongWord: PLongWord;
VarPQWord: PQWord;
VarPShortInt: PShortInt;
varPSmallInt: PSmallInt;
VarPInt: PInteger;
VarPInt64: PInt64;
PVarByte: ^Byte;
PVarWord: ^Word;
PVarLongWord: ^LongWord;
PVarQWord: ^QWord;
PVarShortInt: ^ShortInt;
PvarSmallInt: ^SmallInt;
PVarInt: ^Integer;
PVarInt64: ^Int64;
VarPointer: Pointer;
VarPPointer: PPointer;
PVarPointer: ^Pointer;
VarDouble: Double;
VarExtended: Extended;
PVarDouble: ^Double;
PVarExtended: ^Extended;
{$ENDIF}
{$IFDEF FooFunc_Body}
//begin
VarByte := ArgByte + 100;
VarWord := ArgWord + 100;
VarLongWord := ArgLongWord + 100;
VarQWord := ArgQWord + 100;
VarShortInt := ArgShortInt + 10;
VarSmallInt := ArgSmallInt + 100;
VarInt := ArgInt + 100;
VarInt64 := ArgInt64 + 100;
VarPByte := ArgPByte;
VarPWord := ArgPWord;
VarPLongWord := ArgPLongWord;
VarPQWord := ArgPQWord;
VarPShortInt := ArgPShortInt;
VarPSmallInt := ArgPSmallInt;
VarPInt := ArgPInt;
VarPInt64 := ArgPInt64;
PVarByte := @ArgByte;
PVarWord := @ArgWord;
PVarLongWord := @ArgLongWord;
PVarQWord := @ArgQWord;
PVarShortInt := @ArgShortInt;
PVarSmallInt := @ArgSmallInt;
PVarInt := @ArgInt;
PVarInt64 := @ArgInt64;
VarPointer := ArgPointer;
VarPPointer := ArgPPointer;
PVarPointer := ArgPointer;
VarDouble := ArgDouble;
VarExtended := ArgExtended;
PVarDouble := @ArgDouble;
PVarExtended := @ArgExtended;
{$ENDIF}
{%endregion FooFunc}
{%region GLOBAL}
{$IFDEF Global_Var}
//var
GlobByte: Byte;
GlobWord: Word;
GlobLongWord: LongWord;
GlobQWord: QWord;
GlobShortInt: ShortInt;
GlobSmallInt: SmallInt;
GlobInt: Integer;
GlobInt64: Int64;
GlobPByte: PByte;
GlobPWord: PWord;
GlobPLongWord: PLongWord;
GlobPQWord: PQWord;
GlobPShortInt: PShortInt;
GlobPSmallInt: PSmallInt;
GlobPInt: PInteger;
GlobPInt64: PInt64;
PGlobByte: ^Byte;
PGlobWord: ^Word;
PGlobLongWord: ^LongWord;
PGlobQWord: ^QWord;
PGlobShortInt: ^ShortInt;
PGlobSmallInt: ^SmallInt;
PGlobInt: ^Integer;
PGlobInt64: ^Int64;
GlobPointer: Pointer;
GlobPPointer: PPointer;
PGlobPointer: ^Pointer;
GlobDouble: Double;
GlobExtended: Extended;
PGlobDouble: ^Double;
PGlobExtended: ^Extended;
{$ENDIF}
{$IFDEF Global_Body}
//begin
GlobByte := 25;
GlobWord := 26;
GlobLongWord := 27;
GlobQWord := 28;
GlobShortInt := 35;
GlobSmallInt := 36;
GlobInt := 37;
GlobInt64 := 38;
GlobPByte := @GlobByte;
GlobPWord := @GlobWord;
GlobPLongWord := @GlobLongWord;
GlobPQWord := @GlobQWord;
GlobPShortInt := @GlobShortInt;
GlobPSmallInt := @GlobSmallInt;
GlobPInt := @GlobInt;
GlobPInt64 := @GlobInt64;
PGlobByte := @GlobByte;
PGlobWord := @GlobWord;
PGlobLongWord := @GlobLongWord;
PGlobQWord := @GlobQWord;
PGlobShortInt := @GlobShortInt;
PGlobSmallInt := @GlobSmallInt;
PGlobInt := @GlobInt;
PGlobInt64 := @GlobInt64;
GlobPointer := @GlobByte;
GlobPPointer := @GlobPointer;
PGlobPointer := @GlobPointer;
GlobDouble := 1.123;
GlobExtended := 2.345;
PGlobDouble := @GlobDouble;
PGlobExtended := @GlobExtended;
{$ENDIF}
{$IFDEF Global_Body_NIL}
//begin
GlobByte := 0;
GlobWord := 0;
GlobLongWord := 0;
GlobQWord := 0;
GlobShortInt := 0;
GlobSmallInt := 0;
GlobInt := 0;
GlobInt64 := 0;
GlobPByte := nil;
GlobPWord := nil;
GlobPLongWord := nil;
GlobPQWord := nil;
GlobPShortInt := nil;
GlobPSmallInt := nil;
GlobPInt := nil;
GlobPInt64 := nil;
GlobPointer := nil;
GlobPPointer := nil;
GlobDouble := 0;
GlobExtended := 0;
{$ENDIF}
{$IFDEF Global_Call_FooFunc}
//FooFunc(
GlobByte, GlobByte,
GlobWord, GlobWord,
GlobLongWord, GlobLongWord,
GlobQWord, GlobQWord,
GlobShortInt, GlobShortInt,
GlobSmallInt, GlobSmallInt,
GlobInt, GlobInt,
GlobInt64, GlobInt64,
GlobPByte, GlobPByte,
GlobPWord, GlobPWord,
GlobPLongWord, GlobPLongWord,
GlobPQWord, GlobPQWord,
GlobPShortInt, GlobPShortInt,
GlobPSmallInt, GlobPSmallInt,
GlobPInt, GlobPInt,
GlobPInt64, GlobPInt64,
GlobPointer, GlobPointer,
GlobPPointer, GlobPPointer,
GlobDouble, GlobDouble,
GlobExtended, GlobExtended,
{$ENDIF}
{%endregion GLOBAL}
|