Uniface User Forum

 View Only
  Thread closed by the administrator, not accepting new replies.
  • 1.  Uniface 10: get the content of the resource location in runtime (web)

    ROCKETEER
    Posted 11-19-2018 11:44
    No replies, thread closed.

    get the content of the resource location in runtime (web)

    Author: lammersma@hotmail.com (lammersma)

    Hi all,   In the web asn (runtime) there is a [RESOURCES]  section.  In this section the location of the resource files is defined. This can be a folder and/or uar files. In my script I want to some actions in these resource locations, search through these files and maybe even search in the content of these files. So I want to know all of these file locations. In my proccode/script I don't know the exact name of the asn files. This might make it slightly more complex :)  I tried $settings but it does not return anything I can use. It just returns a $procerror -1118.   I hope someone can help me further with this.   Kind regards, Peter



  • 2.  RE: Uniface 10: get the content of the resource location in runtime (web)

    ROCKETEER
    Posted 11-19-2018 11:44
    No replies, thread closed.

    Hi Peter, what about the (undocumented) $assignments("RESOURCES") ?

    $assignment is what uniface assembles from a couple of ASN Files (like usys.asn etc.) And if you have identical lines, the new ones will replace the older ones. So sometimes you may be surprised when lines are listed which you can not find in "your" ASN file. Or lines do not have the values as you see it in the ASN file. Especially (because it works on a first fit) is when you use file redirections with wildcards.

      As an alternative, I experiment with a "framework" where resources have own ASN files add_to_asn.txt holding logicals like "ABC_HOME" with the (relative) path. After the [RESOURCES] section in the main ASN, I just add a set of #file . esources\add_to_asn.txt #file . esources_help\add_to_asn.txt This allows to spawn commandfiles etc. as $concat($logical("ABC_HOME")," unmyjob.bat ") Let's celebrate 8/8/18 when we will see U10.3, Uli P.S. havn't tested it under WEB conditions, but worked in C/S


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 3.  RE: Uniface 10: get the content of the resource location in runtime (web)

    ROCKETEER
    Posted 11-19-2018 11:44
    No replies, thread closed.

    Hi Peter, On Windows, you can easily get application command line with the windows API GetCommandLineA (defined in kernel32.dll). Then you can parse the result to get the first asn file. Gilles


    Author: Gilles (gls.tools@free.fr)


  • 4.  RE: Uniface 10: get the content of the resource location in runtime (web)

    ROCKETEER
    Posted 11-19-2018 11:44
    No replies, thread closed.
    ulrich-merkel said Hi Peter, what about the (undocumented) $assignments("RESOURCES") ?
    $assignment is what uniface assembles from a couple of ASN Files (like usys.asn etc.) And if you have identical lines, the new ones will replace the older ones. So sometimes you may be surprised when lines are listed which you can not find in "your" ASN file. Or lines do not have the values as you see it in the ASN file. Especially (because it works on a first fit) is when you use file redirections with wildcards.
      As an alternative, I experiment with a "framework" where resources have own ASN files add_to_asn.txt holding logicals like "ABC_HOME" with the (relative) path. After the [RESOURCES] section in the main ASN, I just add a set of #file . esources\add_to_asn.txt #file . esources_help\add_to_asn.txt This allows to spawn commandfiles etc. as $concat($logical("ABC_HOME")," unmyjob.bat ") Let's celebrate 8/8/18 when we will see U10.3, Uli P.S. havn't tested it under WEB conditions, but worked in C/S  

    due to some strange mechanisms, my text got corrupted: The text of the path has the usual realtive-path prefix and starts as "resources" And a typo: it's $assignment()


    Author: ulrich-merkel (ulrichmerkel@web.de)


  • 5.  RE: Uniface 10: get the content of the resource location in runtime (web)

    ROCKETEER
    Posted 11-19-2018 11:44
    No replies, thread closed.

    The undocumented feature does the job: $assignments("RESOURCES")   It feels good to have a undocumented feature again!   BTW, what I try to achieve is to get a list of all available components and their operations in runtime. I thought searching in the sig files might do this tric. Or is there something I overlook?


    Author: lammersma (lammersma@hotmail.com)