; -------------------------------------------------------------------------------- ; @Title: Collection of some helper functions ; @Description: ; This script is a collection of some helper functions for your ; daily work with the PRACTICE script language. ; ; You can call these functions with ; DO ~~/demo/practice/lib.cmm ; ; @Keywords: PRACTICE ; @Author: HLG ; @Copyright: (C) 1989-2019 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: lib.cmm 14936 2019-09-16 11:25:18Z hlohn $ LOCAL &func &arg &result ENTRY &func %line &arg ON ERROR GOTO ( LOCAL &ppf &ppf=OS.PPF() PRINT %ERROR "Sorry, '"+OS.FILE.NAME("&ppf")+"' doesn't know function '&func'" STOP ) &func=STRING.UPR("&func") GOSUB &func &arg ENTRY %LINE &result ENDDO &result //////////////////////////////////////////////////////////////////////////////////////////// VERSION: // Returns the version number of this PRACTICE library // and sets global macro &libver, which contains the version number, too. // Syntax: // DO lib.cmm VERSION // Returns: // The version number of this file // Example: // DO ~~/demo/practice/lib.cmm VERSION // PRINT "lib.cmm is version " %Decimal &libver "." ON ERROR NOTHING GLOBAL &libver &libver=STRing.CUT(STRing.CUT("$Rev: 14936 $",6),-2)+"." RETURN &libver //////////////////////////////////////////////////////////////////////////////////////////// OPENNEW: // Opens a file just like OPEN but seaches for an unused 'bufferno' // Syntax: // DO lib.cmm OPENNEW [