/****************************** Module Header ******************************* * * Module Name: showf.e * * Copyright (c) Netlabs EPM Distribution Project 2002 * * $Id$ * * =========================================================================== * * This file is part of the Netlabs EPM Distribution package and is free * software. You can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * Netlabs EPM Distribution. This library is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * ****************************************************************************/ compile if not defined( SMALL) -- If compiled separately EA_comment 'Show value of a field var' define INCLUDING_FILE = 'SHOWF.E' include 'stdconst.e' const tryinclude 'mycnf.e' const compile if not defined( NLS_LANGUAGE) NLS_LANGUAGE = 'ENGLISH' compile endif include NLS_LANGUAGE'.e' defmain 'ShowF' arg( 1) compile endif ; --------------------------------------------------------------------------- defc ShowF if arg( 1) = '' then getline LineStr call Find_Token( startcol, endcol) FieldVar = substr( LineStr, startcol, endcol - startcol + 1) if leftstr( FieldVar, 1) <> '.' then "SayError Specify a field var or place cursor over one." return endif else FieldVar = arg( 1) endif p = pos( '.', FieldVar) if p = 0 then FieldVar = '.'FieldVar getfileid fid elseif p = 1 then getfileid fid elseif p > 1 then parse value FieldVar with fid'.' -1 FieldVar endif TmpName = 'sf_temp.tmp' TmpFile = GetTmpPath()''TmpName ExName = ChangeStr( '.tmp', TmpName, '.ex') TmpExFile = Get_Env( 'NEPMD_USERDIR')'\ex\'ExName LogFile = ChangeStr( '.ex', TmpExFile, '.log') call EraseTemp( TmpFile) call EraseTemp( TmpExFile) call EraseTemp( LogFile) 'xcom e /c 'TmpFile replaceline 'defmain', 1 insertline ' fid = 'fid, 2 insertline ' ''SayError 'FieldVar' = "''fid'FieldVar'''"''', 3 'xcom File' 'Etpm 'TmpFile if rc then return endif --'UnLink' ExName -- (just in case...) 'sf_temp' call EraseTemp( TmpFile) call EraseTemp( TmpExFile) call EraseTemp( LogFile)