HP3000-L Archives

August 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Woods <[log in to unmask]>
Reply To:
Jeff Woods <[log in to unmask]>
Date:
Wed, 22 Aug 2001 14:14:15 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (53 lines)
At  01:06 PM 8/22/01, Larry Barnes wrote:
>I am creating a script file that aborts at the vary beginning and I'm not
>sure why.  The command file is called DBSTATS
>
>The first few lines are:
>
>  PARM db_fname = 0
>  setvar db_fname !db_fname
>  if db_fname = 0
>   setvar db_fname &
>   "CA" + rht("0"+"!hpyear",2) + rht("0"+"!hpmonth",2) + rht("0"+"!hpdate",2)
>  endif
>  setvar db_first 43
>  setvar db_last finfo('!db_fname.capacity','eof')-14
>
>The error occurs with the setvar db_last

>setvar db_last finfo('0.capacity','eof')-14
>                       ^
>An error occurred while accessing the file for FINFO. (CIERR 9984)
>
>If I do a showvar db@ this is what you get
>
>:showvar db@
>DB_FNAME = CA010822
>DB_FIRST = 43
>
>Why doesn't the setvar db_last like the finfo statement?

Inside a UDC or command file script, dereferencing a value with a name
collision between a parameter and a CI variable (like !db_fname) will use
the value of the parameter instead of the CI variable.  For example, I expect:

parm X=1
set X 2
echo !X

will display the value "2".

I recommend you use different name for parms and CI variables, ala:

parm db_fname_parm=0
set db_fname !db_fname_parm
....


-- Jeff Woods
"The great thing about Open Source software is that you can
have any color screen of death that you want." -- Gavin Scott

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2