[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

3602.0. "Symbol "OA$STATUS = '0' ELSE GET OA$STATUS = '1'" not found" by SOADC1::STREMICK (I want an NCC-1701D!!) Mon Nov 29 1993 20:59

First off, let me say that someone else wrote the enclosed script and I know
very littel about writing applications in ALL-IN-1.  So, I need your help.

This script comes from the Named Data of a form.  The option the user enters is
VH.  The error message of this notes title is displayed to the user on the last
line of the screen.  To me, it would appear to be a syntax error, but what do
I know?  There are two places in the script where the content of the message
could be coming from.

Many thanks in advance!

Jim

===========================================================================

;;VH;;

 .IF $AAS_TYPE EQS ""
 THEN GET OA$DISPLAY = "No item selected"\\GET OA$STATUS = '0'
\IFSTATUS
\.IF $AAS_TYPE EQS "MAIL"
 THEN GET OA$DISPLAY='This option does not apply to MAIL messages'
    \\GET OA$STATUS = '0'
 ELSE GET OA$STATUS = '1'
\IFSTATUS
\TMR SELECT $TMRDOC,OA$_TMR_READ
\GET OA$DISPLAY = "Checking document attributes . . ."
\FORCE
\XOP "~~VERIFY_ROUTING_INFO~~"
\IFSTATUS
\GET #IPKEY = TMR$VARIABLE$:NAME.VALUE:16["APPLICATION"]
 TMR$VARIABLE$:NAME.VALUE:16["DOCUMENT_KEY"]
\.IF AAS_INPROCESS.STATUS[#IPKEY] EQS "X"
 THEN GET OA$DISPLAY = "That document has been deleted"
    \\TMR SELECT ""
    \\.IF OA$CURDOC_DELETE EQS "N"
         THEN WRITE CHANGE CAB$ %KEY=OA$CURDOC,DELETE="Y"
    \\CAB DELETE_DOCUMENT OA$CURDOC
    \\WRITE DELETE AAS_INPROCESS %KEY=#IPKEY
    \\GET $AAS_DOC = $TMRDOC = ""
    \\GET OA$STATUS = '0'
 ELSE GET OA$STATUS = '1'
\IFSTATUS
\GET #CKEY = #IPKEY:32 OA$USER
\.IF AAS_COMPLETED.STATUS[#CKEY] EQS "X"
 THEN GET OA$DISPLAY = "That document has been deleted"
    \\TMR SELECT ""
    \\.IF OA$CURDOC_DELETE EQS "N"
         THEN WRITE CHANGE CAB$ %KEY=OA$CURDOC,DELETE="Y"
    \\CAB DELETE_DOCUMENT OA$CURDOC
    \\WRITE DELETE AAS_COMPLETED %KEY=#CKEY
    \\GET $AAS_DOC = $TMRDOC = ""
    \\GET OA$STATUS = '0'
 ELSE GET OA$STATUS = '1'
\IFSTATUS
\DO TMR$CL_DISPLAY_HISTORY
\TMR SELECT ""
T.RTitleUserPersonal
Name
DateLines
3602.1Nested .IF problemIOSG::MAURICEInsufficient hair for flowerTue Nov 30 1993 08:4064
    Hi,
    
    The problem is caused by nested .IF statements that have THEN and ELSE
    keywords. 
    
    However in your example you can just rip out the ELSE statements - they
    were setting OA$STATUS to 1 in a situation where it was guaranteed to
    be set to 1 already. I've edited your code to do that, and also added a
    line at the top, as follows:
    
;;VH;;

GET OA$STATUS = 1
\.IF $AAS_TYPE EQS ""
 THEN GET OA$DISPLAY = "No item selected"\\GET OA$STATUS = '0'
\IFSTATUS
\.IF $AAS_TYPE EQS "MAIL"
 THEN GET OA$DISPLAY='This option does not apply to MAIL messages'
    \\GET OA$STATUS = '0'
\IFSTATUS
\TMR SELECT $TMRDOC,OA$_TMR_READ
\GET OA$DISPLAY = "Checking document attributes . . ."
\FORCE
\XOP "~~VERIFY_ROUTING_INFO~~"
\IFSTATUS
\GET #IPKEY = TMR$VARIABLE$:NAME.VALUE:16["APPLICATION"]
 TMR$VARIABLE$:NAME.VALUE:16["DOCUMENT_KEY"]
\.IF AAS_INPROCESS.STATUS[#IPKEY] EQS "X"
 THEN GET OA$DISPLAY = "That document has been deleted"
    \\TMR SELECT ""
    \\.IF OA$CURDOC_DELETE EQS "N"
         THEN WRITE CHANGE CAB$ %KEY=OA$CURDOC,DELETE="Y"
    \\CAB DELETE_DOCUMENT OA$CURDOC
    \\WRITE DELETE AAS_INPROCESS %KEY=#IPKEY
    \\GET $AAS_DOC = $TMRDOC = ""
    \\GET OA$STATUS = '0'
\IFSTATUS
\GET #CKEY = #IPKEY:32 OA$USER
\.IF AAS_COMPLETED.STATUS[#CKEY] EQS "X"
 THEN GET OA$DISPLAY = "That document has been deleted"
    \\TMR SELECT ""
    \\.IF OA$CURDOC_DELETE EQS "N"
         THEN WRITE CHANGE CAB$ %KEY=OA$CURDOC,DELETE="Y"
    \\CAB DELETE_DOCUMENT OA$CURDOC
    \\WRITE DELETE AAS_COMPLETED %KEY=#CKEY
    \\GET $AAS_DOC = $TMRDOC = ""
    \\GET OA$STATUS = '0'
\IFSTATUS
\DO TMR$CL_DISPLAY_HISTORY
\TMR SELECT ""

    There are two important tools to help
    you debug Named Data. The first is to interactively type the command
    
    <DEBUG ON
    
    This gets you into the ALL-IN-1 debugger, and when you type VH at the
    menu you can follow the Named data logic step by step.
    
    There are also trace options which you can turn on by pressing GOLD %.
    
    Cheers
    
    Stuart
3602.2What about adding a null ELSE on the inner most IF?SOADC1::STREMICKI want an NCC-1701D!!Tue Nov 30 1993 19:3124
	.
	.
	.
\.IF AAS_INPROCESS.STATUS[#IPKEY] EQS "X"
 THEN GET OA$DISPLAY = "That document has been deleted"
    \\TMR SELECT ""
    \\.IF OA$CURDOC_DELETE EQS "N"
         THEN WRITE CHANGE CAB$ %KEY=OA$CURDOC,DELETE="Y"
	 ELSE GET OA$STATUS = 1					<-- 'Null' Else?
    \\CAB DELETE_DOCUMENT OA$CURDOC
    \\WRITE DELETE AAS_INPROCESS %KEY=#IPKEY
    \\GET $AAS_DOC = $TMRDOC = ""
    \\GET OA$STATUS = '0'
 ELSE GET OA$STATUS = '1'
\IFSTATUS
	.
	.
	.

------------

I believe the intent is to execute the remainder of the procedure is the first
delete code did not complete successully.  Without the ELSE on the outter most
IF, the procedure would terminate is the delete code failed.
3602.4Try DEBUG, TRACE, or re-writeROMEOS::LESLIE_DAGreetings &amp; SolutionsWed Dec 01 1993 21:5214
    I think the guidance you received in .1 is probably the best thing to
    do: figure out from a trace (press <Gold> % to set trace options) where
    the code is blowing up or use the ALL-IN-1 debugger.
    
    If *I* were troubleshooting this, *I* would try to simplify the code to
    perform a bundle of XOPs instead of trying to do it all in a single
    named data entry.
    
    If you decide to do the trace, but can't decipher the results, post
    your trace file here and I'm sure you'll get some kind soul to help
    out.
    
    HTH,
Dan
3602.5MoreIOSG::MAURICEInsufficient hair for flowerWed Dec 01 1993 22:0734
    Re .3
    
    Nested .IF's of the form
    
    If
      then
        if
          then
          else
      else
    
    do not work in Named Data. They do work in scripts, so you can change
    the Named Data to the 1 line
    
    	DO your_script_name
    
    In the script .if .end_if .then and .else can be used, i.e.
    
    .If
      .then
        .if
          .then
          .else
        .end_if
      .else
    .end_if
    
    **HOWEVER** FWIW I disagree with your interpretation of what the code is
    trying to do. I still think taking the ELSE statements out will
    achieve the effect desired by the original coder.
    
    Cheers
    
    Stuart
3602.6XOPitBRUMMY::MARTIN::BELLMartin Bell, NETCC, Birmingham UKThu Dec 02 1993 09:0924
I agree with .4, that you should use XOPs to make the code more readable,
and also to avoid possible syntax problems (named data isn't the easiest
thing in the world to read, never mind debug)

Thus you end up with code such as

if $FOO eqs ""
 then
  xop "~~FOO_MISSING~~"
 else
  xop "~~FOO_OK~~"


;;~~FOO_MISSING~~;;

get oa$display="Please supply a FOO"


;;~~FOO_OK~~;;

.if $BAR eqs "N" then get $FOO="Fred"\
more stuff\
even more stuff\
and more