Re: File/function info
Posted in 1991
Path: emory!swrinde!cs.utexas.edu!uunet!mcsun!uknet!stl!th From: th@stl.stc.co.uk (Tony Heskett) Newsgroups: comp.databases.informix Summary: Use revision control Keywords: SCCS RCS Message-ID: <5176@stl.co.uk> Date: 27 Nov 91 20:12:19 GMT References: <1991Nov26.172748.176@wvus.org> Sender: news@bnr.co.uk Reply-To: "Tony Heskett" <th@bnr.co.uk> Organization: BNR Europe Limited, London Road, Harlow, Essex, UK cbruce@wvus.org (Corinne Bruce) writes: >Our problem is this: we need to be able to return [ from 4GL ] -- as >part of the error >message -- the filename (or, better yet, the function name) in which the >error occurred. In C applications, this isn't a big deal. But, how do we >do this from 4GL programs? As far as we've been able to determine, there isn't >an elegant way to do this from 4GL, and we'd really rather not have to use >additional variables to hard-code this in the error processing function calls. > >Does anyone know if Informix 4GL has a way of doing this? Suggestions for >undocumented features are also welcome, as it appears this application is >being largely built on "undocumented features". How 'bout putting the whole source code under SCCS (or RCS or Sorcerer's Apprentice (? I think)), then using that to give you strings with the filename, line no., version no., etc. in ? You gotta declare char variables to hold the info in the 4GL programs, and arrange to return the info, and it won't give you function names. BUT it will do most of what you want, and a whole lot more besides. Also, (first time for me !) it's not a dirty hack ... These are the keywords you get with sccs - try man sccs, man sccs-get for more info, perhaps. %A% Shorthand notation for an ID line with data for what(1): %Z%%Y% %M% %I%%Z% %B% SID branch component %C% Current line number. Intended for identifying messages output by the program such as ``this shouldn't have happened'' type errors. It is not intended to be used on every line to provide sequence numbers. %D% Current date: yy/mm/dd %E% Date newest applied delta was created: yy/mm/dd %F% SCCS s.file name %G% Date newest applied delta was created: mm/dd/yy %H% Current date: mm/dd/yy %I% SID of the retrieved version: %R%.%L%.%B%.%S% %L% SID level component %M% Module name: either the value of the m flag in the s.file (see sccs-admin(1)), or the name of the s.file less the prefix %P% Fully qualified s.file name %Q% Value of the q flag in the s.file %R% SID Release component %S% SID Sequence component %T% Current time: hh:mm:ss %U% Time the newest applied delta was created: hh:mm:ss %W% Shorthand notation for an ID line with data for what: %Z%%M% %I% %Y% Module type: value of the t flag in the s.file %Z% 4-character string: `@(#)', recognized by what. The painful bit is writing the makefiles, esp. if you're working from the programmer's environment (cos you'll have to stop :-). But if you're doing anything decent-sized, it's almost certainly the way to go. >Corinne Bruce Project Lead > >World Vision U.S. cbruce@wvus.org >919 W. Huntington Dr. Voice: 818.357.1111 ext 3510 >Monrovia, CA 91016 FAX: 818.303.6212 Hope this helps, looks like you're keeping busy ! Cheers - Tony. _______________________________________________________________________________ Tony Heskett th@bnr.co.uk |Voice: (+44) 279 429531 x 2637 BNR, London Road, Harlow, Essex, CM17 9NA |Fax: (+44) 279 454187 Cheers - Tony. _______________________________________________________________________________ Tony Heskett th@bnr.co.uk |Voice: (+44) 279 429531 x 2637 BNR, London Road, Harlow, Essex, CM17 9NA |Fax: (+44) 279 454187