Abstract

This paper will touch on the lack of mechanisms to pass arguments back from defined functions other than return values, if return values are already used as error codes. An extreme case is the use of call-back functions, or event procedures, to the events of GUI objects. In Dyalog APL/W, functionality of arguments and return values of call-back functions are already well-defined. The way you can pass information back from a call-back function, or event procedure, is by storing it as a global variable or by storing it into the Data property of an GUI object, which is also a global variable. This paper proposes a solution - utilize a Call-by-Reference mechanism of function arguments passing, in addition to return values of defined function, to pass results of defined functions back to calling functions. The programming environment is in Dyalog APL/W Version 7.1.3. This interpreter is robust itself and is feature-rich in terms of the integration of APL and MS Windows GUI environment. This paper starts with a description of problems encountered when programming in a GUI environment with call-back functions as well as the difference in design logic of programming styles among procedural programming and event-driven programming. Secondly, this paper presents a brief description of two different mechanisms to pass arguments into and out of defined functions. Thirdly, this paper presents a design solution to the problems mentioned above based on the Call-by-Reference mechanism described in second part. Lastly, a conclusion is made and potential pitfalls are explored.All code segments demonstrated here are implemented and tested in Dyalog APL/W Version 7.1.3.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.