Four Js Development Tools Forum

General => Ask Reuben => Topic started by: Reuben B. on March 31, 2023, 12:02:04 am



Title: Ask Reuben 166 - Reflection
Post by: Reuben B. on March 31, 2023, 12:02:04 am
Imagine a library function that takes two arguments, an SQL statement and an array variable of any flat record structure.  This function executes the SQL statement and populates the array variable with the result-set of the SQL statement. 

Code
  1. CALL sql2array(sql-statement, array-variable)

The Reflection API was introduced in Genero 4.00 and allows you to write such generic functions thus cutting down on the number of lines of code you have to maintain.  It does this by allowing you at runtime to inspect program elements such as variables and in some cases modify their values.
 
Read more athttps://4js.com/ask-reuben/ig-166/