============================================================================ A-Shell Release Notes Version 6.5.1647.1 (22 Sep 2018) ============================================================================ 1. AUI_EVENTWAIT refinement: static 'buttons' (i.e. static controls with the MBF_KBD flag set so they act like clickable buttons) are now compatible with the EVW_EXCDFOCUS flag if the MBF_TABSTOP flag is also set. 2. AUI_EVENTWAIT enhancement: a new flag -- EVW_BGFOCUS (&h01000000) -- has been added as an alternative way to highlight static text controls that have the eventwait focus. Instead of underlining the text (as with EVW_ULFOCUS), it makes the background color slightly lighter. (This probably only makes sense with static 'buttons' that have colored backgrounds. Note that if the control is too light, it will be darkened instead. 3. DYNLIB.SBR bug fix: The DCOP_UNLOAD operation wasn't fully removing the library from memory. For some libraries (such as the DigitalPersona fingerprint library), this might have caused it to misbehave when initialized for a second time during the same A-Shell session. ============================================================================ A-Shell Release Notes Version 6.5.1647.0 (21 Sep 2018) ============================================================================ 1. Compiler (edit 879) language extension: dynamic function calls. These are function calls that are dynamically bound (i.e. resolved) at runtime rather than at compile time. To define a function that can be dynamically bound, insert the new keyword "dynamic" in front of the Function keyword in the functino definition. Dynamic Function Fn'Foo(...) ... EndFunction Tagging a function for dynamic binding like this does not interfere with traditional statically bound calls to the function; it simply opens up the additional possibility of dynamic binding. To call the function with dynamic binding, use one of the new system functions DYNFUNC() or DYNFUNC$() ... DYNFUNC(funcname,arg1,...,argN) ! numeric function DYNFUNC$(funcname,arg1,...,argN) ! string function These are analogous to the XFUNC() and XFUNC$() system functions (used to dynamically call external functions implemented as SBX modules), except that here the target function is part of (i.e. compiled within) the current program. As with XFUNC()/XFUNC$(), the first argument (funcname here) is a string expression resolving at runtime to the name of the function to call. Examples: a$ = DYNFUNC$("Fn'Foo$",arg1,arg2) n = 27 f$ = "Fn'Foo" + str(n) + "$" call DYNFUNC$(f$,arg1,arg2,arg3) ? DYNFUNC(Fn'Get'FuncName$(x),arg1,arg2) The first example calls the string function Fn'Foo$(arg1,arg2) The second calls a string function Fn'Foo27$(arg1,arg2,arg3) The last calls a function whose name is returned from Fn'Get'FuncName$(x). A new BASIC error code, 72 (undefined dynamic function) has been defined and added to the ERRMSG.xxx files. It will be triggered by an attempt to to dynamically call a function which is not declared dynamic within the current program. Note that in all cases, the choice of DYNFUNC() vs DYNFUNC$() determines whether the function is expected to return a string or numeric value. Since the type of a function is determined by the presences of a "$" suffix, the presence or absence of the suffix on the DYNFUNC keyword should agree at runtime with the name of the target function. In other words, use DYNFUNC() to call numeric functions, and DYNFUNC$() to call string functions. (Neither the compiler nor the runtime system will complain if you mix types, but the results are likely to disappoint.) Compatibility: RUN / SBX modules with Dynamic functions declared are fully compatible with earlier versions of A-Shell. But an attempt to call them from within an A-Shell session earlier than 6.5.1647.0 will generate an unsupported function error (35). 2. Compiler (edit 880) language extension: use of ellipsis (...) in argument lists to facilitate passing arguments through a wrapper function. An example will make this more clear. Consider the following function: Function Fn'DynFunc$(fn$ as s260:inputonly, ...) as s0 on error goto trap Fn'DynFunc$ = dynfunc$(fn$, ...) exitfunction trap: if err(0) = 72 then ! if function not found Fn'DynFunc$ = .NULL ! set result to null resume endfunction ! and return with no error else resume endfunction with_error ! else pass error through endif EndFunction The function serves as a wrapper to the underlying dynfunc$() call; it adds value trapping the function-not-found error and returning .NULL instead. The ellipsis mechanism eliminates what would otherwise be a sticky problem - we have no idea how many parameters will be passed, so there is no good way to code the dynfunc$() call. With the ellipsis mechanism, the "..." in the dynfunc$(fn$, ...) call is replaced by the actual parameters corresponding to the ...in the Fn'DynFunc$() call, allowing us to pass them through without knowing anything about them. 3. Compiler (edit 881) - Support .fn (case INsensitive) within a function as an alias for the function name variable. For example... Function Fn'Foo(a as b2) as f6 .fn = a**2 ! equivalent to Fn'Foo = a**2 EndFunction Note that the $ suffix is not used here; the .FN alias applies to both string and numeric functions. 4. Compiler (edit 882) - Various fixes/refinments: - The dynfunc mechanism now allows for retrieval of function return type information (see MX_DYNFUNC below). - TRACE.PRINT statements with the (level) and/or (level,tags) option were throwing bogus syntax errors for variations that weren't errors. 5. New MIAMEX sub-function MX_DYNFUNC (193) for DYNFUNC-related utilities. xcall MIAMEX, MX_DYNFUNC, op, funcname$, status, type$, size where: op (num) [in] Opcode. Currently only one opcode supported (1), which returns existence, type, and size info for the specified dynamic function. funcname$ (str) [in] Name of the function to inquire about. Case sensitive. Must be tagged with the Dynamic keyword for it to be visible. status (signed int) [out] Returns 1 if found, 0 if not found, <0 for errors type$ (str) [out] Returns the type of the function, which could be an internal type e.g. ("B", "S", "X", "F", or "I") or a DEFSTRUCT type. size (num) [out] Returns the length in bytes of the function's return value. 6. AXL library for Windows (Libxl.dll) updated from 3.7.2 to 3.8.3 - several bug fixes and refinements, primarily to XLXS support. 7. Runtime bug fix: passing an iterator evaluating to "" as a parameter to a function was in some cases generating a bogus error 63 (parameter type mismatch). ============================================================================ A-Shell Release Notes Version 6.5.1646.6 (15 Sep 2018) ============================================================================ 1. Compiler refinements/fixes (edit 879) - - Revise compilation of ds.field(x) and ds.@fname$(x) to allow for better runtime error detection and handling. Incorrect use of ds.@fname$(x) in place of ds.@fname$(x)(y) can now be trapped at runtime (error 71 - undefined dynstruct member). Any programs using DYNSTRUCT must be recompiled! - Improve robustness of file-based MX_DYNSTRUCT DYNOP_DEF - Disable the auto-tracing (activated by ++PRAGMA TRACE_BEGIN) of MAP statements with initializers, as this was leading to spurious errors. - Fix spurious compiler error on IF RESUME