4D v13.4Arrays and Pointers |
||
|
4D v13.4
Arrays and Pointers
Arrays and Pointers
You can pass an array as parameter to a 4D command or to the routine of a 4D Plug-in. On the other hand, you cannot pass an array as parameter to a user method. The alternative is to pass a pointer to the array as parameter to the method. You can pass process and interprocess, process or local arrays as parameters. Here are some examples.
If((0<atNames)&(atNames<Size of array(atNames)) If you need to do the same thing for 50 different arrays in various forms, you can avoid writing the same thing 50 times, by using the following project method: ` SELECT NEXT ELEMENT project method Then, you can write: SELECT NEXT ELEMENT(->atNames)
` Array sum Then, you can write: $vlSum:=Array sum(->arSalaries)
` CAPITALIZE ARRAY Then, you can write: CAPITALIZE ARRAY(->atSubjects) The combination of arrays, pointers, and looping structures, such as For...End for, allows you to write many useful small project methods for handling arrays. |
PROPERTIES
Product: 4D SEE ALSO
Arrays |