HP3000-L Archives

May 2000, 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:
Erik Vistica <[log in to unmask]>
Reply To:
Erik Vistica <[log in to unmask]>
Date:
Fri, 26 May 2000 11:53:42 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (97 lines)
Oops, left one cmdfile out. It can probably be replaced with the CI
function WORD().

PARM BUF, DELIM=' ', POS=1
COMMENT FILE=TOKEN.CMDSUB
SETVAR TOKEN_BUF RTRIM (LTRIM ('!BUF'))
IF !POS = 0
  SETVAR TOKEN TOKEN_BUF
ELSE
  IF !POS > 0
    SETVAR TOKEN_BEGIN POS ('!DELIM',TOKEN_BUF,!POS-1) + 1
    SETVAR TOKEN_END   POS ('!DELIM',TOKEN_BUF,!POS)
  ELSE
    SETVAR TOKEN_BEGIN POS ('!DELIM',TOKEN_BUF,!POS) + 1
    SETVAR TOKEN_END   POS ('!DELIM',TOKEN_BUF,!POS+1)
  ENDIF

  IF TOKEN_END = 0
    SETVAR TOKEN_LEN LEN (TOKEN_BUF) - TOKEN_BEGIN + 1
  ELSE
    SETVAR TOKEN_LEN TOKEN_END - TOKEN_BEGIN
  ENDIF

  IF !POS <> 1 AND TOKEN_BEGIN = 1 AND TOKEN_END = 0
    SETVAR TOKEN ''
  ELSE
    SETVAR TOKEN STR (TOKEN_BUF,TOKEN_BEGIN,TOKEN_LEN)
  ENDIF
ENDIF

DELETEVAR TOKEN_@
COMMENT END TOKEN.CMDSUB



Erik Vistica wrote:
>
> FWIW, here are some command files that I use to do setvars (and other
> things) on the local system to match setvars on the remote (execute them
> from the local system). The approach is the same as what Barry has
> already shown. Just more generic (pronounced 'complex') and canned.
>
> ANYPARM VARSET=''
> COMMENT FILE=LCLSETVR.CMD
> REMOTE FILE SHOWVART=SHOWVART:$BACK
> REMOTE SHOWVAR !VARSET >*SHOWVART
>
> FORREC <SHOWVART LCLSETV2
>
> PURGE SHOWVART,TEMP
> REMOTE RESET SHOWVART
>
> DELETEVAR FORREC_BUF
> DELETEVAR FORREC_BUF_FOUND
> DELETEVAR LCLSETV2_VARNAME
> DELETEVAR TOKEN
> COMMENT END LCLSETVR.CMD
>
> PARM CMD, VARNAME=FORREC_BUF
> COMMENT FILE=FORREC.CMDSUB
>
> SETVAR FORREC_BUF_FOUND FALSE
> CONTINUE
> WHILE NOT FORREC_BUF_FOUND
>   SETVAR HPCIERR OK
>   SETVAR HPMSGFENCE 2
>     CONTINUE
>     INPUT !VARNAME
>   SETVAR HPMSGFENCE 0
>   IF HPCIERR <> OK
>     RETURN
>   ENDIF
>   SETVAR !VARNAME RTRIM (LTRIM ('![!VARNAME]'))
>   CONTINUE
>   !CMD
> ENDWHILE
> COMMENT END FORREC.CMDSUB
>
> PARM VARSET=''
> COMMENT FILE=LCLSETV2.CMDSUB
> TOKEN '!FORREC_BUF'
> SETVAR LCLSETV2_VARNAME RTRIM (TOKEN)
>
> TOKEN '!FORREC_BUF',,-1
> SETVAR LCLSETVR_!LCLSETV2_VARNAME '!TOKEN'
> COMMENT END LCLSETV2.CMDSUB
>
> The above 3 command files let me have vars on a remote machine and on
> the local machine I can get their values mirrored by doing:
>
> :LCLSETVR MYVAR@
>
> The same var names as on the remote machine will be created on the local
> machine prepended with LCLSETVR_
>
> HTH

ATOM RSS1 RSS2