Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: How to know what modules (.4gls) are in a particular .42m?  (Read 7187 times)
Sally W.
Posts: 32


« on: July 12, 2012, 05:24:38 pm »

Had the following on a customer's machine:

Date: 12/07/2012    Time: 14:27:23                                             
Program error at 'scratchpad.4gl', line number 0.                               
FORMS statement error number -6208.                                             
Module 'scratchpad': already loaded.

Eventually I recompiled all of the library functions and put the latest set on their box.

However it will be a big job to produce a set with exactly the same versions as they currently have, unless there is a quick way I don't know of identifying which ones have the module 'scratchpad' included?  Then I can just recompile those.

Is there a smart way to do this?
Julian B.
Posts: 2


« Reply #1 on: July 13, 2012, 01:08:34 pm »

The .42m generally corresponds 1:1 with the .4gl source file.  You need to look in the .42r file.  It's a simple structure and you can write some C code to interpret it properly, but for most purposes (assuming you are on a *nix OS) you can just use strings(1) to get the names out of them.  E.g.

strings program.42r | grep scratchpad

If you want to be cleverer or the word scratchpad appears in too many function names, a quick and dirty script like this will work (slowly).  e.g.

genref -m *.42r | grep scratchpad.42m

Regards,

Code
  1. #! /bin/sh
  2.  
  3. modules=false
  4.  
  5. if [ "$1" = "-m" ]
  6. then
  7.    modules=true
  8.    shift
  9. fi
  10.  
  11. for f in $*
  12. do
  13.    strings $f |
  14.    {
  15.        read jjtok || break
  16.        if [ "$jjtok" != "JJJJ" ]
  17.        then
  18.            echo "Error: $f is not a Genero file"
  19.            break
  20.        fi
  21.  
  22.        while true
  23.        do
  24.            read function || break
  25.            read module || break
  26.            if $modules
  27.            then
  28.                if [ "$lastmod" != "$module" ]
  29.                then
  30.                    echo "$f:   $module.42m"
  31.                fi
  32.                lastmod=$module
  33.            else
  34.                echo "$f:       $module.42m     $function()"
  35.            fi
  36.        done
  37.    }
  38. done


Julian
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines