Note: the .self attribute is always read-only by the user.
define procedure main (void) { declare char my_string[256]; declare pointer my_pointer; set my_pointer = my_string[0].self.address; }
Note: example two (below) demonstrates how to use metada attributes in a procedure that accepts a varying number of arguments.
define procedure print (...) { declare pointer my_pointer; declare int i; for (i = 0 to print.parameter_list_size) { set my_pointer = print.parameter[i].self.address.address; } } set player_name = "Rob"; set secret_number = 42; call print ("Congratulations %s. You guessed my number! It was %d\n", player_name, secret_number);
Note: example three (below) demonstrates how to manipulate the value of COMPLEX numbers using metadata attributes.
define procedure main (void) { declare complex complex_num; declare imaginary imaginary_num; set complex_num.real_component = 1.01; set complex_num.imaginary_component = 5; set imaginary_number = complex_num.imaginary_component; }
Copyright © 2025 Robert James Bruce.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at https://www.gnu.org/licenses/fdl-1.3.html