INFO-VAX	Mon, 12 Nov 2007	Volume 2007 : Issue 620

   Contents:
Re: DCL IF / NESTED IF-THEN-ELSE
Filezilla connection
Re: Hardcopy documentation
Re: Process state in HIB while paging
Re: Process state in HIB while paging
Re: Process state in HIB while paging
Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: Q: DCL IF / NESTED IF-THEN-ELSE
Re: VAX, VMS and QBUS Devices
Re: VAX, VMS and QBUS Devices

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

Date: Mon, 12 Nov 2007 15:01:18 -0000
From: "Richard Brodie" <R.Brodie@rl.ac.uk>
Subject: Re: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <fh9pru$jg6$1@south.jnrs.ja.net>

><norm.raphael@metso.com> wrote in message 
>news:OFBE6B1F44.B71162C3-ON85257391.004F1E11->85257391.00507A6A@metso.com...

> What am I missing?

I think that the $ ELSE matches the $ THEN, not the previous
IF statement, which isn't a block IF. 

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

Date: Mon, 12 Nov 2007 11:44:32 -0700
From: Kevin Handy <kth@srv.net>
Subject: Filezilla connection
Message-ID: <1194892635_8953@sp12lax.superfeed.net>

Has anyone gotten filezilla 3.0.2.1 (under windows) to talk to
a VMS system? I've used it on earlier versions of filezilla,
but cannot get this to work.

I've been trying all morning, and have nothing but grief.

I get a timeout, or an empty directory listing.
I've tried both active ans passive modes.
FTP from the DOS prompt works fine.

under the "advanced" tab, I select "Servertype: VMS",
so I assume that someone once thought it sould work.

Also, if I enter a colon ':' in the "Default remote directory"
field, as in "dka0:[xxxx]", it quietly blanks the field.

Or, is there a simple FTP gui program that I can use instead?

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

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

Date: Mon, 12 Nov 2007 14:22:25 -0000
From:  IrishPub <irishpub@gmail.com>
Subject: Re: Hardcopy documentation
Message-ID: <1194877345.765951.319780@d55g2000hsg.googlegroups.com>

On Nov 11, 4:46 pm, VAXman-  @SendSpamHere.ORG wrote:
> In article <amLZi.4299$pg.3...@newsfe6-win.ntli.net>, "Robert Jarratt" <nos...@nosp.am> writes:
>
> >"IrishPub" <irish...@gmail.com> wrote in message
> >news:1194745876.265898.48990@v3g2000hsg.googlegroups.com...
> >> On Nov 10, 2:00 pm, "Robert Jarratt" <nos...@nosp.am> wrote:
> >>> I would be interested but it depends on where you are and how much it
> >>> would
> >>> cost to ship them (to the UK). I am especially interested in Orange
> >>> manuals
> >>> as these are the ones I particularly remember.
>
> >>> Regards
>
> >>> Rob
>
> >>> "IrishPub" <irish...@gmail.com> wrote in message
>
> >>>news:1194700744.926865.301030@d55g2000hsg.googlegroups.com...
>
> >>> > Greetings,
>
> >>> > I have boxes of VMS documentation that I am looking for a new home
> >>> > for.  I was wondering if there is any interest in this.  I have VMS
> >>> > 4.x documentation (the Orange covered manuals), VMS 5.x (the Gray
> >>> > covered manuals) and OpenVMS documentation (White covers).  If there
> >>> > is interest I can provide more specifics about which manuals I have
> >>> > (all should be near complete sets, but they have been sitting for
> >>> > awhile so I would want to check to be sure).
>
> >>> > I also have various books on VMS, including Internals that I would be
> >>> > willing to part with as well.
>
> >>> > If this is not the right forum, I apologize as I tried to find a group
> >>> > that would be appropriate for this.
>
> >>> > Thanks for taking a look,
> >>> >    -Ron Patrick
>
> >> I am located near St Louis, Missouri.  The White set is dated May 1993
> >> for Open VMS VAX 6.0 (Open VMS AXP 1.5)
>
> >Any idea what it would cost to ship the Orange ones to the UK? If I remember
> >correctly there were 8 volumes, which Orange ones do you have?
>
> Then it is incomplete.  I have about 20 large orange tomes and about a
> dozen smaller orange tomes on my shelf.
>
> Do you know the publication/version of your white doc set?  (V6.*)  I
> have most of the programer's set (device driver and other intriguing
> system programming manuals).  May 1993 is the date on one that I just
> pulled from the shelf.
>
> --
> VAXman- A Bored Certified VMS Kernel Mode Hacker   VAXman(at)TMESIS(dot)COM
>
>   "Well my son, life is like a beanstalk, isn't it?"
>
> http://tmesis.com/drat.html


The publication date for the white set is May 1993.  Its for Version
6.0 (VMS on VAX) or version 1.5 (VMS on AXP)

As far as the Orange set goes, I am sure I have more than 8 volumes...
I will get a list together this evening and post.
Shipping to UK from US via USPS isn't cheap as there isnt any media
mail rate for overseas.   I can check into other carriers and see what
they have.

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

Date: Mon, 12 Nov 2007 07:13:05 GMT
From: John Santos <john.santos@post.harvard.edu>
Subject: Re: Process state in HIB while paging
Message-ID: <MPG.21a1c6ec45fa1b2e989772@news.bellatlantic.net>

In article <cc544$4737f481$cef8887a$6791@TEKSAVVY.COM>, 
jfmezei.spamnot@vaxination.ca says...
> Mozilla eventually eats up all its pgflquo and becomes slow as molasses 
> running on a Microvax II running at 1/10th normal speed.
> 
> I can see the disk light on the workstation on a "steady on" (the only 
> thing used on that disk is the page file).
> 
> Yet, the process stays mostly in "HIB" state. I sometimes see it PFW 
> state for a micro instant if I don't blink.
> 
> Doing a "QUIT" (once I get to the menu)  takes a few *minutes* to run. 
> During that time, the disk activity light is steady on again. And again, 
> the process remains mostly on HIB state 99% of the time.
> 
> Can someone explain why Mozilla would remain in HIB state when it is 
> waiting for memory coming from the page file 99% of the time ? Why isn't 
> it in PFW state ?
> 
> Since Mozilla comes from Unixland, I would find it hard to believe it is 
> fully AST driven.
> 
> I realise that in your universe, Mozilla runs fine and my universe is 
> ever so slightly different from yours, but I would still be interested 
> in what sort of programming paradigm would have resulted in Mozilla 
> being in HUB even when waiting to access memory that resides in the page 
> file.
> 

I didn't even know you *could* run Mozilla on a MVII!  I'm 99% sure
CSWB is Alpha/Itanium only.  Is there a Mozilla from elsewhere that
will compile/run on a VAX?  (I think Mosaic works on VAXes, but that's
another story entirely.)

Anyway Mozilla (CSWB version) was slow running on an Alpha 1200
(single processor, 5/533 w/512MB, displaying on an AlphaStation
200 4/100 running DEC Unix V4.x), but was usable.

I've since moved to an rx2620 dual processor 1.6GHz, 4GB using the
console graphics adapter, and its pretty peppy, except it still
takes a bit of time to start up.  Of course, no one else is using
the Itanium much yet (except all our backups go through it to an
external USB hard disk, which seems to have no discernable effect
on Mozilla's performance), but gradually other developers are
shifting over to it.

So I think the weird thing about the JF universe is that fact
that Mozilla works at all on an MVII, not that it's slow.  :-)

As to your actual question, are you sure its paging and not
just doing regular (async) I/O?  If it's using QIO, it might
be $HIBER while waiting for a completion AST to $WAKE it,
rather than using $WAITEF or $SYNCH (which I think would LEF.)

Or if it's threaded, maybe a thread is stalled on PFW, but
other threads (or the main thread) is $HIBERing.  Haven't
dealt enough with threads to know for sure.

-- 
John

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

Date: Mon, 12 Nov 2007 02:53:19 -0500
From: JF Mezei <jfmezei.spamnot@vaxination.ca>
Subject: Re: Process state in HIB while paging
Message-ID: <dd469$47380670$cef8887a$17795@TEKSAVVY.COM>

John Santos wrote:
> 
> I didn't even know you *could* run Mozilla on a MVII! 

No, you can't. But when it fills up its page file quota on the alpha (it 
is something like 1 gig), Mozilla slows down to a speed that is about 
1/10 the speed of a Microvax II ;-(  (Like: you have plenty of time to 
grab a cub of coffee between the time you press on a RELOAD button and 
the time it actually has completed the reloading).

> Or if it's threaded, maybe a thread is stalled on PFW, but
> other threads (or the main thread) is $HIBERing.  Haven't
> dealt enough with threads to know for sure.


Ahhh ! That would be the best explanation.  Thanks.

Next time I get into that situation (in a few days), I will use the 
newly available features of SHOW PROC/CONt and type "T" instead of "Q" 
to get thread information.

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

Date: 12 Nov 2007 07:39:47 -0600
From: koehler@eisner.nospam.encompasserve.org (Bob Koehler)
Subject: Re: Process state in HIB while paging
Message-ID: <wcfDi2s7MMGm@eisner.encompasserve.org>

In article <MPG.21a1c6ec45fa1b2e989772@news.bellatlantic.net>, John Santos <john.santos@post.harvard.edu> writes:
> 
> I didn't even know you *could* run Mozilla on a MVII!  I'm 99% sure
> CSWB is Alpha/Itanium only.  Is there a Mozilla from elsewhere that
> will compile/run on a VAX?  (I think Mosaic works on VAXes, but that's
> another story entirely.)

   I've been running Mozilla on VAXen for a long, long, time.  CSWB is
   not (or at least didn't used to be) 64 bit only.  What you can't get
   for Mozilla (or any web browser) on VAX is Java support, since a
   JRE for VAX isn't worth the effort (floating point format issues).

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

Date: Mon, 12 Nov 2007 09:39:05 -0500
From: norm.raphael@metso.com
Subject: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <OFBE6B1F44.B71162C3-ON85257391.004F1E11-85257391.00507A6A@metso.com>

This is a multipart message in MIME format.
--=_alternative 00507A6585257391_=
Content-Type: text/plain; charset="US-ASCII"

Here is a DCL gosub routine to pick a description 
out of an element list.  If it does not find 
a match in 1-5 is is supposed to set the LL 
index variable to zero and pick that one.
Somehow, the statement to do that is not being 
executed.  DCL_CHECK does not find any error.

What am I missing?

$FIND_TCODE: !Gosub
$ LL=5
$LOOPT:
$ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
$  THEN
$ LL=LL+1
$ show sym ll
$ IF LL .LE. 5 THEN GOTO LOOPT
$  ELSE
$  IF LL .GT. 5 THEN LL=0
$ ENDIF
$ show sym ll
$ RDESC=F$ELEMENT(LL,",",TDESC)
$ RETURN

===
-*- Charlie Hammond's unsupported DCL checker (Version V3.4) -*-
Checking file TEST.COM;1
12-NOV-2007 09:33:40.69

Checking for DCL_CHECK$ logicals...
No translation for logical name DCL_CHECK$*

Starting Pass 1 -- 12-NOV-2007 09:33:41.11 ...
Starting Pass 2 -- 12-NOV-2007 09:33:41.76 ...
Starting Pass 3 -- 12-NOV-2007 09:33:41.86 ...

Procedure contains:     14 total lines
                        14 code lines (including 1 lines (7%) w/ comments)
                         0 additional continuation lines
                         0 lines w/i $DECK/$EOD pairs
                         0 comment only lines (0% of code lines)
                         0 blank lines
                         1 diagnostics

 LINE  CODE  --DIAGNOSTIC MESSAGE--
    1  LNR-I  label "FIND_TCODE" not referenced (warning)

-*- END OF LISTING -*-   12-NOV-2007 09:33:42.22

===

$FIND_TCODE: !Gosub
$ LL=5
$LOOPT:
$ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
$  THEN
$ LL=LL+1
$ show sym ll
  LL = 6   Hex = 00000006  Octal = 00000000006
$ IF LL .LE. 5 THEN GOTO LOOPT
$  ELSE ![What happened to the next statement?]  <-- ***
$ ENDIF
$ show sym ll
  LL = 6   Hex = 00000006  Octal = 00000000006
$ RDESC=F$ELEMENT(LL,",",TDESC)
$ RETURN



--=_alternative 00507A6585257391_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2><tt>Here is a DCL gosub routine to pick a description
</tt></font>
<br><font size=2><tt>out of an element list. &nbsp;If it does not find
</tt></font>
<br><font size=2><tt>a match in 1-5 is is supposed to set the LL </tt></font>
<br><font size=2><tt>index variable to zero and pick that one.</tt></font>
<br><font size=2><tt>Somehow, the statement to do that is not being </tt></font>
<br><font size=2><tt>executed. &nbsp;DCL_CHECK does not find any error.</tt></font>
<br>
<br><font size=2><tt>What am I missing?</tt></font>
<br>
<br><font size=2><tt>$FIND_TCODE: !Gosub</tt></font>
<br><font size=2><tt>$ LL=5</tt></font>
<br><font size=2><tt>$LOOPT:</tt></font>
<br><font size=2><tt>$ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)</tt></font>
<br><font size=2><tt>$ &nbsp;THEN</tt></font>
<br><font size=2><tt>$ LL=LL+1</tt></font>
<br><font size=2><tt>$ show sym ll</tt></font>
<br><font size=2><tt>$ IF LL .LE. 5 THEN GOTO LOOPT</tt></font>
<br><font size=2><tt>$ &nbsp;ELSE</tt></font>
<br><font size=2><tt>$ &nbsp;IF LL .GT. 5 THEN LL=0</tt></font>
<br><font size=2><tt>$ ENDIF</tt></font>
<br><font size=2><tt>$ show sym ll</tt></font>
<br><font size=2><tt>$ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)</tt></font>
<br><font size=2><tt>$ RETURN</tt></font>
<br>
<br><font size=2><tt>===</tt></font>
<br><font size=2><tt>-*- Charlie Hammond's unsupported DCL checker (Version
V3.4) -*-</tt></font>
<br><font size=2><tt>Checking file TEST.COM;1</tt></font>
<br><font size=2><tt>12-NOV-2007 09:33:40.69</tt></font>
<br>
<br><font size=2><tt>Checking for DCL_CHECK$ logicals...</tt></font>
<br><font size=2><tt>No translation for logical name DCL_CHECK$*</tt></font>
<br>
<br><font size=2><tt>Starting Pass 1 -- 12-NOV-2007 09:33:41.11 ...</tt></font>
<br><font size=2><tt>Starting Pass 2 -- 12-NOV-2007 09:33:41.76 ...</tt></font>
<br><font size=2><tt>Starting Pass 3 -- 12-NOV-2007 09:33:41.86 ...</tt></font>
<br>
<br><font size=2><tt>Procedure contains: &nbsp; &nbsp; 14 total lines</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 14 code lines (including 1 lines (7%) w/ comments)</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 additional continuation lines</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 lines w/i $DECK/$EOD pairs</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 comment only lines (0% of code lines)</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 blank lines</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 diagnostics</tt></font>
<br>
<br><font size=2><tt>&nbsp;LINE &nbsp;CODE &nbsp;--DIAGNOSTIC MESSAGE--</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; 1 &nbsp;LNR-I &nbsp;label &quot;FIND_TCODE&quot;
not referenced (warning)</tt></font>
<br>
<br><font size=2><tt>-*- END OF LISTING -*- &nbsp; 12-NOV-2007 09:33:42.22</tt></font>
<br>
<br><font size=2><tt>===</tt></font>
<br>
<br><font size=2><tt>$FIND_TCODE: !Gosub</tt></font>
<br><font size=2><tt>$ LL=5</tt></font>
<br><font size=2><tt>$LOOPT:</tt></font>
<br><font size=2><tt>$ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)</tt></font>
<br><font size=2><tt>$ &nbsp;THEN</tt></font>
<br><font size=2><tt>$ LL=LL+1</tt></font>
<br><font size=2><tt>$ show sym ll</tt></font>
<br><font size=2><tt>&nbsp; LL = 6 &nbsp; Hex = 00000006 &nbsp;Octal =
00000000006</tt></font>
<br><font size=2><tt>$ IF LL .LE. 5 THEN GOTO LOOPT</tt></font>
<br><font size=2><tt>$ &nbsp;ELSE ![What happened to the next statement?]
&nbsp;&lt;-- ***</tt></font>
<br><font size=2><tt>$ ENDIF</tt></font>
<br><font size=2><tt>$ show sym ll</tt></font>
<br><font size=2><tt>&nbsp; LL = 6 &nbsp; Hex = 00000006 &nbsp;Octal =
00000000006</tt></font>
<br><font size=2><tt>$ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)</tt></font>
<br><font size=2><tt>$ RETURN</tt></font>
<br>
<br><font size=2 face="sans-serif"><br>
</font>
--=_alternative 00507A6585257391_=--

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

Date: Mon, 12 Nov 2007 10:01:03 -0500
From: "Ken Robinson" <kenrbnsn@gmail.com>
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <7dd80f60711120701q578537e5w8a14b5d2ac8718b@mail.gmail.com>

On Nov 12, 2007 9:39 AM,  <norm.raphael@metso.com> wrote:
>
> Here is a DCL gosub routine to pick a description
> out of an element list.  If it does not find
> a match in 1-5 is is supposed to set the LL
> index variable to zero and pick that one.
> Somehow, the statement to do that is not being
> executed.  DCL_CHECK does not find any error.
>
> What am I missing?
>
> $FIND_TCODE: !Gosub
> $ LL=5
> $LOOPT:
> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> $  THEN
> $ LL=LL+1
> $ show sym ll
> $ IF LL .LE. 5 THEN GOTO LOOPT
> $  ELSE
> $  IF LL .GT. 5 THEN LL=0
> $ ENDIF
> $ show sym ll
> $ RDESC=F$ELEMENT(LL,",",TDESC)
> $ RETURN

The "endif" is in the wrong place. Also, shouldn't "TDESC" be "TCODE"
in "$ RDESC=F$ELEMENT(LL,",",TDESC)"?

Try:

$FIND_TCODE: !Gosub
$ LL=5
$LOOPT:
$ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
$  THEN
$    LL=LL+1
$    show sym ll
$    IF LL .LE. 5 THEN GOTO LOOPT
$ endif
$ IF LL .GT. 5 THEN LL=0
$ show sym ll
$ RDESC=F$ELEMENT(LL,",",Tcode)
$ sho sym rdesc
$ RETURN

Ken

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

Date: Mon, 12 Nov 2007 10:25:14 -0500
From: norm.raphael@metso.com
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <OFE0523AD4.D215CC7B-ON85257391.00540521-85257391.0054B45D@metso.com>

This is a multipart message in MIME format.
--=_alternative 0054B45A85257391_=
Content-Type: text/plain; charset="US-ASCII"

"Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:01:03 AM:

> On Nov 12, 2007 9:39 AM,  <norm.raphael@metso.com> wrote:
> >
> > Here is a DCL gosub routine to pick a description
> > out of an element list.  If it does not find
> > a match in 1-5 is is supposed to set the LL
> > index variable to zero and pick that one.
> > Somehow, the statement to do that is not being
> > executed.  DCL_CHECK does not find any error.
> >
> > What am I missing?
> >
> > $FIND_TCODE: !Gosub
> > $ LL=5
> > $LOOPT:
> > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> > $  THEN
> > $ LL=LL+1
> > $ show sym ll
> > $ IF LL .LE. 5 THEN GOTO LOOPT
> > $  ELSE
> > $  IF LL .GT. 5 THEN LL=0
> > $ ENDIF
> > $ show sym ll
> > $ RDESC=F$ELEMENT(LL,",",TDESC)
> > $ RETURN
> 
> The "endif" is in the wrong place. Also, shouldn't "TDESC" be "TCODE"
> in "$ RDESC=F$ELEMENT(LL,",",TDESC)"?

Well, the code certainly behaves as if the endif is in the wrong place, 
but it isn't.  I will try structured if-the-else for all the 
if-statements and I'm sure that will fix it, but I suspect I have 
uncovered an ambiguity due to backward compatibility allowing 
if-then-else to be:

$if <condition> then <statement>
$endif

instead of forcing:

$if <condition>
$then 
$<statement>
$endif

I would surely like to know what the expected behavior is, and 
if this violates the syntax.  Too bad Charlie retired.

And no, TDESC should be TDESC.  It matches the code in one 
element table and move the description from another 
element table, but that's not relevent and since I didn't 
include that part of the procedure, you can't know that.

> 
> Try:
> 
> $FIND_TCODE: !Gosub
> $ LL=5
> $LOOPT:
> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> $  THEN
> $    LL=LL+1
> $    show sym ll
> $    IF LL .LE. 5 THEN GOTO LOOPT
> $ endif
> $ IF LL .GT. 5 THEN LL=0
> $ show sym ll
> $ RDESC=F$ELEMENT(LL,",",Tcode)
> $ sho sym rdesc
> $ RETURN
> 
> Ken

--=_alternative 0054B45A85257391_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br><font size=2><tt>&quot;Ken Robinson&quot; &lt;kenrbnsn@gmail.com&gt;
wrote on 11/12/2007 10:01:03 AM:<br>
<br>
&gt; On Nov 12, 2007 9:39 AM, &nbsp;&lt;norm.raphael@metso.com&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Here is a DCL gosub routine to pick a description<br>
&gt; &gt; out of an element list. &nbsp;If it does not find<br>
&gt; &gt; a match in 1-5 is is supposed to set the LL<br>
&gt; &gt; index variable to zero and pick that one.<br>
&gt; &gt; Somehow, the statement to do that is not being<br>
&gt; &gt; executed. &nbsp;DCL_CHECK does not find any error.<br>
&gt; &gt;<br>
&gt; &gt; What am I missing?<br>
&gt; &gt;<br>
&gt; &gt; $FIND_TCODE: !Gosub<br>
&gt; &gt; $ LL=5<br>
&gt; &gt; $LOOPT:<br>
&gt; &gt; $ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
&gt; &gt; $ &nbsp;THEN<br>
&gt; &gt; $ LL=LL+1<br>
&gt; &gt; $ show sym ll<br>
&gt; &gt; $ IF LL .LE. 5 THEN GOTO LOOPT<br>
&gt; &gt; $ &nbsp;ELSE<br>
&gt; &gt; $ &nbsp;IF LL .GT. 5 THEN LL=0<br>
&gt; &gt; $ ENDIF<br>
&gt; &gt; $ show sym ll<br>
&gt; &gt; $ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)<br>
&gt; &gt; $ RETURN<br>
&gt; <br>
&gt; The &quot;endif&quot; is in the wrong place. Also, shouldn't &quot;TDESC&quot;
be &quot;TCODE&quot;<br>
&gt; in &quot;$ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)&quot;?</tt></font>
<br>
<br><font size=2><tt>Well, the code certainly behaves as if the endif is
in the wrong place, </tt></font>
<br><font size=2><tt>but it isn't. &nbsp;I will try structured if-the-else
for all the </tt></font>
<br><font size=2><tt>if-statements and I'm sure that will fix it, but I
suspect I have </tt></font>
<br><font size=2><tt>uncovered an ambiguity due to backward compatibility
allowing </tt></font>
<br><font size=2><tt>if-then-else to be:</tt></font>
<br>
<br><font size=2><tt>$if &lt;condition&gt; then &lt;statement&gt;</tt></font>
<br><font size=2><tt>$endif<br>
</tt></font>
<br><font size=2><tt>instead of forcing:</tt></font>
<br>
<br><font size=2><tt>$if &lt;condition&gt;</tt></font>
<br><font size=2><tt>$then </tt></font>
<br><font size=2><tt>$&lt;statement&gt;</tt></font>
<br><font size=2><tt>$endif</tt></font>
<br>
<br><font size=2><tt>I would surely like to know what the expected behavior
is, and </tt></font>
<br><font size=2><tt>if this violates the syntax. &nbsp;Too bad Charlie
retired.</tt></font>
<br>
<br><font size=2><tt>And no, TDESC should be TDESC. &nbsp;It matches the
code in one </tt></font>
<br><font size=2><tt>element table and move the description from another
</tt></font>
<br><font size=2><tt>element table, but that's not relevent and since I
didn't </tt></font>
<br><font size=2><tt>include that part of the procedure, you can't know
that.</tt></font>
<br>
<br><font size=2><tt>&gt; <br>
&gt; Try:<br>
&gt; <br>
&gt; $FIND_TCODE: !Gosub<br>
&gt; $ LL=5<br>
&gt; $LOOPT:<br>
&gt; $ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
&gt; $ &nbsp;THEN<br>
&gt; $ &nbsp; &nbsp;LL=LL+1<br>
&gt; $ &nbsp; &nbsp;show sym ll<br>
&gt; $ &nbsp; &nbsp;IF LL .LE. 5 THEN GOTO LOOPT<br>
&gt; $ endif<br>
&gt; $ IF LL .GT. 5 THEN LL=0<br>
&gt; $ show sym ll<br>
&gt; $ RDESC=F$ELEMENT(LL,&quot;,&quot;,Tcode)<br>
&gt; $ sho sym rdesc<br>
&gt; $ RETURN<br>
&gt; <br>
&gt; Ken<br>
</tt></font>
--=_alternative 0054B45A85257391_=--

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

Date: Mon, 12 Nov 2007 10:48:25 -0500
From: "Ken Robinson" <kenrbnsn@gmail.com>
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <7dd80f60711120748j60ea8c6br91989b132441b1e3@mail.gmail.com>

On Nov 12, 2007 10:25 AM,  <norm.raphael@metso.com> wrote:
>
>
>
>
> "Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:01:03 AM:
>
>
>  > On Nov 12, 2007 9:39 AM,  <norm.raphael@metso.com> wrote:
>  > >
>  > > Here is a DCL gosub routine to pick a description
>  > > out of an element list.  If it does not find
>  > > a match in 1-5 is is supposed to set the LL
>  > > index variable to zero and pick that one.
>  > > Somehow, the statement to do that is not being
>  > > executed.  DCL_CHECK does not find any error.
>  > >
>  > > What am I missing?
>  > >
>  > > $FIND_TCODE: !Gosub
>  > > $ LL=5
>  > > $LOOPT:
>  > > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
>  > > $  THEN
>  > > $ LL=LL+1
>  > > $ show sym ll
>  > > $ IF LL .LE. 5 THEN GOTO LOOPT
>  > > $  ELSE
>  > > $  IF LL .GT. 5 THEN LL=0
>  > > $ ENDIF
>  > > $ show sym ll
>  > > $ RDESC=F$ELEMENT(LL,",",TDESC)
>  > > $ RETURN
>  >
>  > The "endif" is in the wrong place. Also, shouldn't "TDESC" be "TCODE"
>  > in "$ RDESC=F$ELEMENT(LL,",",TDESC)"?
>
> Well, the code certainly behaves as if the endif is in the wrong place,
> but it isn't.  I will try structured if-the-else for all the
> if-statements and I'm sure that will fix it, but I suspect I have
> uncovered an ambiguity due to backward compatibility allowing
> if-then-else to be:
>
> $if <condition> then <statement>
> $endif
>

That syntax is illegal


> instead of forcing:
>
> $if <condition>
> $then
> $<statement>
> $endif
>
> I would surely like to know what the expected behavior is, and
> if this violates the syntax.  Too bad Charlie retired.

You original "if" block was (annotated by me)

$ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
$    THEN
$        LL=LL+1
$        show sym ll
$        IF LL .LE. 5 THEN GOTO LOOPT
$    ELSE    ! this else goes with the original "IF" not the one above it
$       IF LL .GT. 5 THEN LL=0   ! this line will only get executed
when the original "if" is "false"
$ ENDIF

Ken



>
> And no, TDESC should be TDESC.  It matches the code in one
> element table and move the description from another
> element table, but that's not relevent and since I didn't
> include that part of the procedure, you can't know that.
>
>
>
> >
>  > Try:
>  >
>  > $FIND_TCODE: !Gosub
>  > $ LL=5
>  > $LOOPT:
>  > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
>  > $  THEN
>  > $    LL=LL+1
>  > $    show sym ll
>  > $    IF LL .LE. 5 THEN GOTO LOOPT
>  > $ endif
>  > $ IF LL .GT. 5 THEN LL=0
>  > $ show sym ll
>  > $ RDESC=F$ELEMENT(LL,",",Tcode)
>  > $ sho sym rdesc
>  > $ RETURN
>  >
>  > Ken
>

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

Date: Mon, 12 Nov 2007 11:13:29 -0500
From: JF Mezei <jfmezei.spamnot@vaxination.ca>
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <46b54$47387bab$cef8887a$4590@TEKSAVVY.COM>

norm.raphael@metso.com wrote:
> $FIND_TCODE: !Gosub
> $ LL=5
> $LOOPT:
> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> $ 	THEN
> $ 		LL=LL+1
> $ 		show sym ll
> $ 		IF LL .LE. 5 THEN GOTO LOOPT
> $  			     ELSE
> $  			         IF LL .GT. 5 THEN LL=0
> $ 		ENDIF
> $ 	show sym ll
> $ 	RDESC=F$ELEMENT(LL,",",TDESC)
> $ 	RETURN



Missing ENDIF for the IF FCODE .NES. F$ELEMENT. The RETURN statement 
executes within the THEN of the IF FCODE.

The RETURN probably unwinds any IF/ENDIF and hence no errors.

It helps to properly indent code when you have nested IFs.

Also, this is just my opinion, but I tend to not mix one line with 
multiple line THEN/ELSE statements. It makes it easier to determine when 
an endif is needed or not.

aka:
$IF hungry .eqs. 1
$THEN
$	GOTO SNACK_BAR
$ELSE
$	DO THIS
$	DO THAT
$ENDIF

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

Date: Mon, 12 Nov 2007 11:42:27 -0500
From: norm.raphael@metso.com
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <OF1C1B5E66.2CCB43E8-ON85257391.005A1479-85257391.005BC5CF@metso.com>

This is a multipart message in MIME format.
--=_alternative 005BC5CD85257391_=
Content-Type: text/plain; charset="US-ASCII"

"Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:48:25 AM:

> On Nov 12, 2007 10:25 AM,  <norm.raphael@metso.com> wrote:
> >
> >
> >
> >
> > "Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:01:03 AM:
> >
> >
> >  > On Nov 12, 2007 9:39 AM,  <norm.raphael@metso.com> wrote:
> >  > >
> >  > > Here is a DCL gosub routine to pick a description
> >  > > out of an element list.  If it does not find
> >  > > a match in 1-5 is is supposed to set the LL
> >  > > index variable to zero and pick that one.
> >  > > Somehow, the statement to do that is not being
> >  > > executed.  DCL_CHECK does not find any error.
> >  > >
> >  > > What am I missing?
> >  > >
> >  > > $FIND_TCODE: !Gosub
> >  > > $ LL=5
> >  > > $LOOPT:
> >  > > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> >  > > $  THEN
> >  > > $ LL=LL+1
> >  > > $ show sym ll
> >  > > $ IF LL .LE. 5 THEN GOTO LOOPT
> >  > > $  ELSE
> >  > > $  IF LL .GT. 5 THEN LL=0
> >  > > $ ENDIF
> >  > > $ show sym ll
> >  > > $ RDESC=F$ELEMENT(LL,",",TDESC)
> >  > > $ RETURN
> >  >
> >  > The "endif" is in the wrong place. Also, shouldn't "TDESC" be 
"TCODE"
> >  > in "$ RDESC=F$ELEMENT(LL,",",TDESC)"?
> >
> > Well, the code certainly behaves as if the endif is in the wrong 
place,
> > but it isn't.  I will try structured if-the-else for all the
> > if-statements and I'm sure that will fix it, but I suspect I have
> > uncovered an ambiguity due to backward compatibility allowing
> > if-then-else to be:
> >
> > $if <condition> then <statement>
> > $endif
> >
> 
> That syntax is illegal
> 
> 
> > instead of forcing:
> >
> > $if <condition>
> > $then
> > $<statement>
> > $endif
> >
> > I would surely like to know what the expected behavior is, and
> > if this violates the syntax.  Too bad Charlie retired.
> 
> You original "if" block was (annotated by me)
> 
> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> $    THEN
> $        LL=LL+1
> $        show sym ll
> $        IF LL .LE. 5 THEN GOTO LOOPT
> $    ELSE    ! this else goes with the original "IF" not the one above 
it
> $       IF LL .GT. 5 THEN LL=0   ! this line will only get executed
> when the original "if" is "false"
> $ ENDIF
> 

I simplified it to:

$FIND_TCODE: !Gosub
$ LL=5
$LOOPT:
$ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
$ THEN
$ LL=LL+1
$ show sym ll
$  IF LL .GT. 5 
$  THEN
$   LL=0
$  ELSE
$   GOTO LOOPT
$  ENDIF
$ ENDIF
$ show sym ll
$ RDESC=F$ELEMENT(LL,",",TDESC)
$ RETURN

It was redundent to check for ".GT. 5" and also 
".LE. 5" for if not one then of course the other.

The crux of the problem is that within an 
$IF <condition_1>
$THEN
$<statement_t1>
$<statement_t2>
$ELSE
$<statement_e1>
$<statement_e2>
$ENDIF

that
$<statement_pn>
should be able to be the (valid) statement
  $IF <condition_x> then <statement_y>

and that in the complex IF-THEN-ELSE the 
"$THEN" 
must be on it's own line to distinguish 
between the two forms.

Probably if I had put a replacement statement 
before the $ELSE the parser would have recovered.

It's better this way, however.

-Norm

> Ken
> 
> 
> 
> >
> > And no, TDESC should be TDESC.  It matches the code in one
> > element table and move the description from another
> > element table, but that's not relevent and since I didn't
> > include that part of the procedure, you can't know that.
> >
> >
> >
> > >
> >  > Try:
> >  >
> >  > $FIND_TCODE: !Gosub
> >  > $ LL=5
> >  > $LOOPT:
> >  > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> >  > $  THEN
> >  > $    LL=LL+1
> >  > $    show sym ll
> >  > $    IF LL .LE. 5 THEN GOTO LOOPT
> >  > $ endif
> >  > $ IF LL .GT. 5 THEN LL=0
> >  > $ show sym ll
> >  > $ RDESC=F$ELEMENT(LL,",",Tcode)
> >  > $ sho sym rdesc
> >  > $ RETURN
> >  >
> >  > Ken
> >

--=_alternative 005BC5CD85257391_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br><font size=2><tt>&quot;Ken Robinson&quot; &lt;kenrbnsn@gmail.com&gt;
wrote on 11/12/2007 10:48:25 AM:<br>
<br>
&gt; On Nov 12, 2007 10:25 AM, &nbsp;&lt;norm.raphael@metso.com&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &quot;Ken Robinson&quot; &lt;kenrbnsn@gmail.com&gt; wrote on
11/12/2007 10:01:03 AM:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; On Nov 12, 2007 9:39 AM, &nbsp;&lt;norm.raphael@metso.com&gt;
wrote:<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; Here is a DCL gosub routine to pick a description<br>
&gt; &gt; &nbsp;&gt; &gt; out of an element list. &nbsp;If it does not
find<br>
&gt; &gt; &nbsp;&gt; &gt; a match in 1-5 is is supposed to set the LL<br>
&gt; &gt; &nbsp;&gt; &gt; index variable to zero and pick that one.<br>
&gt; &gt; &nbsp;&gt; &gt; Somehow, the statement to do that is not being<br>
&gt; &gt; &nbsp;&gt; &gt; executed. &nbsp;DCL_CHECK does not find any error.<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; What am I missing?<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; $FIND_TCODE: !Gosub<br>
&gt; &gt; &nbsp;&gt; &gt; $ LL=5<br>
&gt; &gt; &nbsp;&gt; &gt; $LOOPT:<br>
&gt; &gt; &nbsp;&gt; &gt; $ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
&gt; &gt; &nbsp;&gt; &gt; $ &nbsp;THEN<br>
&gt; &gt; &nbsp;&gt; &gt; $ LL=LL+1<br>
&gt; &gt; &nbsp;&gt; &gt; $ show sym ll<br>
&gt; &gt; &nbsp;&gt; &gt; $ IF LL .LE. 5 THEN GOTO LOOPT<br>
&gt; &gt; &nbsp;&gt; &gt; $ &nbsp;ELSE<br>
&gt; &gt; &nbsp;&gt; &gt; $ &nbsp;IF LL .GT. 5 THEN LL=0<br>
&gt; &gt; &nbsp;&gt; &gt; $ ENDIF<br>
&gt; &gt; &nbsp;&gt; &gt; $ show sym ll<br>
&gt; &gt; &nbsp;&gt; &gt; $ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)<br>
&gt; &gt; &nbsp;&gt; &gt; $ RETURN<br>
&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; The &quot;endif&quot; is in the wrong place. Also,
shouldn't &quot;TDESC&quot; be &quot;TCODE&quot;<br>
&gt; &gt; &nbsp;&gt; in &quot;$ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)&quot;?<br>
&gt; &gt;<br>
&gt; &gt; Well, the code certainly behaves as if the endif is in the wrong
place,<br>
&gt; &gt; but it isn't. &nbsp;I will try structured if-the-else for all
the<br>
&gt; &gt; if-statements and I'm sure that will fix it, but I suspect I
have<br>
&gt; &gt; uncovered an ambiguity due to backward compatibility allowing<br>
&gt; &gt; if-then-else to be:<br>
&gt; &gt;<br>
&gt; &gt; $if &lt;condition&gt; then &lt;statement&gt;<br>
&gt; &gt; $endif<br>
&gt; &gt;<br>
&gt; <br>
&gt; That syntax is illegal<br>
&gt; <br>
&gt; <br>
&gt; &gt; instead of forcing:<br>
&gt; &gt;<br>
&gt; &gt; $if &lt;condition&gt;<br>
&gt; &gt; $then<br>
&gt; &gt; $&lt;statement&gt;<br>
&gt; &gt; $endif<br>
&gt; &gt;<br>
&gt; &gt; I would surely like to know what the expected behavior is, and<br>
&gt; &gt; if this violates the syntax. &nbsp;Too bad Charlie retired.<br>
&gt; <br>
&gt; You original &quot;if&quot; block was (annotated by me)<br>
&gt; <br>
&gt; $ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
&gt; $ &nbsp; &nbsp;THEN<br>
&gt; $ &nbsp; &nbsp; &nbsp; &nbsp;LL=LL+1<br>
&gt; $ &nbsp; &nbsp; &nbsp; &nbsp;show sym ll<br>
&gt; $ &nbsp; &nbsp; &nbsp; &nbsp;IF LL .LE. 5 THEN GOTO LOOPT<br>
&gt; $ &nbsp; &nbsp;ELSE &nbsp; &nbsp;! this else goes with the original
&quot;IF&quot; not the one above it<br>
&gt; $ &nbsp; &nbsp; &nbsp; IF LL .GT. 5 THEN LL=0 &nbsp; ! this line will
only get executed<br>
&gt; when the original &quot;if&quot; is &quot;false&quot;<br>
&gt; $ ENDIF<br>
&gt; </tt></font>
<br>
<br><font size=2><tt>I simplified it to:</tt></font>
<br>
<br><font size=2><tt>$FIND_TCODE: !Gosub<br>
$ LL=5<br>
$LOOPT:<br>
$ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
$ THEN<br>
$ LL=LL+1<br>
$ show sym ll<br>
$ &nbsp;IF LL .GT. 5 <br>
$ &nbsp;THEN</tt></font>
<br><font size=2><tt>$ &nbsp; LL=0</tt></font>
<br><font size=2><tt>$ &nbsp;ELSE<br>
$ &nbsp; GOTO LOOPT</tt></font>
<br><font size=2><tt>$ &nbsp;ENDIF<br>
$ ENDIF<br>
$ show sym ll<br>
$ RDESC=F$ELEMENT(LL,&quot;,&quot;,TDESC)<br>
$ RETURN</tt></font>
<br>
<br><font size=2><tt>It was redundent to check for &quot;.GT. 5&quot; and
also </tt></font>
<br><font size=2><tt>&quot;.LE. 5&quot; for if not one then of course the
other.</tt></font>
<br>
<br><font size=2><tt>The crux of the problem is that within an </tt></font>
<br><font size=2><tt>$IF &lt;condition_1&gt;</tt></font>
<br><font size=2><tt>$THEN</tt></font>
<br><font size=2><tt>$&lt;statement_t1&gt;</tt></font>
<br><font size=2><tt>$&lt;statement_t2&gt;</tt></font>
<br><font size=2><tt>$ELSE</tt></font>
<br><font size=2><tt>$&lt;statement_e1&gt;</tt></font>
<br><font size=2><tt>$&lt;statement_e2&gt;</tt></font>
<br><font size=2><tt>$ENDIF</tt></font>
<br>
<br><font size=2><tt>that</tt></font>
<br><font size=2><tt>$&lt;statement_pn&gt;</tt></font>
<br><font size=2><tt>should be able to be the (valid) statement</tt></font>
<br><font size=2><tt>&nbsp; $IF &lt;condition_x&gt; then &lt;statement_y&gt;</tt></font>
<br>
<br><font size=2><tt>and that in the complex IF-THEN-ELSE the </tt></font>
<br><font size=2><tt>&quot;$THEN&quot; </tt></font>
<br><font size=2><tt>must be on it's own line to distinguish </tt></font>
<br><font size=2><tt>between the two forms.</tt></font>
<br>
<br><font size=2><tt>Probably if I had put a replacement statement </tt></font>
<br><font size=2><tt>before the $ELSE the parser would have recovered.</tt></font>
<br>
<br><font size=2><tt>It's better this way, however.</tt></font>
<br>
<br><font size=2><tt>-Norm</tt></font>
<br><font size=2><tt><br>
&gt; Ken<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; &gt;<br>
&gt; &gt; And no, TDESC should be TDESC. &nbsp;It matches the code in one<br>
&gt; &gt; element table and move the description from another<br>
&gt; &gt; element table, but that's not relevent and since I didn't<br>
&gt; &gt; include that part of the procedure, you can't know that.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &nbsp;&gt; Try:<br>
&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; $FIND_TCODE: !Gosub<br>
&gt; &gt; &nbsp;&gt; $ LL=5<br>
&gt; &gt; &nbsp;&gt; $LOOPT:<br>
&gt; &gt; &nbsp;&gt; $ IF FCODE .NES. F$ELEMENT(LL,&quot;,&quot;,TCODE)<br>
&gt; &gt; &nbsp;&gt; $ &nbsp;THEN<br>
&gt; &gt; &nbsp;&gt; $ &nbsp; &nbsp;LL=LL+1<br>
&gt; &gt; &nbsp;&gt; $ &nbsp; &nbsp;show sym ll<br>
&gt; &gt; &nbsp;&gt; $ &nbsp; &nbsp;IF LL .LE. 5 THEN GOTO LOOPT<br>
&gt; &gt; &nbsp;&gt; $ endif<br>
&gt; &gt; &nbsp;&gt; $ IF LL .GT. 5 THEN LL=0<br>
&gt; &gt; &nbsp;&gt; $ show sym ll<br>
&gt; &gt; &nbsp;&gt; $ RDESC=F$ELEMENT(LL,&quot;,&quot;,Tcode)<br>
&gt; &gt; &nbsp;&gt; $ sho sym rdesc<br>
&gt; &gt; &nbsp;&gt; $ RETURN<br>
&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; Ken<br>
&gt; &gt;<br>
</tt></font>
--=_alternative 005BC5CD85257391_=--

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

Date: Mon, 12 Nov 2007 12:27:28 -0500
From: sol gongola <sol@adldata.com>
Subject: Re: Q: DCL IF / NESTED IF-THEN-ELSE
Message-ID: <Q10_i.4280$jd6.1992@newsfe08.lga>

norm.raphael@metso.com wrote:
> 
> 
> 
> 
> "Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:48:25 AM:
> 
>> On Nov 12, 2007 10:25 AM,  <norm.raphael@metso.com> wrote:
>> >
>> >
>> >
>> >
>> > "Ken Robinson" <kenrbnsn@gmail.com> wrote on 11/12/2007 10:01:03 AM:
>> >
>> >
>> >  > On Nov 12, 2007 9:39 AM,  <norm.raphael@metso.com> wrote:
>> >  > >
>> >  > > Here is a DCL gosub routine to pick a description
>> >  > > out of an element list.  If it does not find
>> >  > > a match in 1-5 is is supposed to set the LL
>> >  > > index variable to zero and pick that one.
>> >  > > Somehow, the statement to do that is not being
>> >  > > executed.  DCL_CHECK does not find any error.
>> >  > >
>> >  > > What am I missing?
>> >  > >
>> >  > > $FIND_TCODE: !Gosub
>> >  > > $ LL=5
>> >  > > $LOOPT:
>> >  > > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
>> >  > > $  THEN
>> >  > > $ LL=LL+1
>> >  > > $ show sym ll
>> >  > > $ IF LL .LE. 5 THEN GOTO LOOPT
>> >  > > $  ELSE
>> >  > > $  IF LL .GT. 5 THEN LL=0
>> >  > > $ ENDIF
>> >  > > $ show sym ll
>> >  > > $ RDESC=F$ELEMENT(LL,",",TDESC)
>> >  > > $ RETURN
>> >  >
>> >  > The "endif" is in the wrong place. Also, shouldn't "TDESC" be "TCODE"
>> >  > in "$ RDESC=F$ELEMENT(LL,",",TDESC)"?
>> >
>> > Well, the code certainly behaves as if the endif is in the wrong place,
>> > but it isn't.  I will try structured if-the-else for all the
>> > if-statements and I'm sure that will fix it, but I suspect I have
>> > uncovered an ambiguity due to backward compatibility allowing
>> > if-then-else to be:
>> >
>> > $if <condition> then <statement>
>> > $endif
>> >
>>
>> That syntax is illegal
>>
>>
>> > instead of forcing:
>> >
>> > $if <condition>
>> > $then
>> > $<statement>
>> > $endif
>> >
>> > I would surely like to know what the expected behavior is, and
>> > if this violates the syntax.  Too bad Charlie retired.
>>
>> You original "if" block was (annotated by me)
>>
>> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
>> $    THEN
>> $        LL=LL+1
>> $        show sym ll
>> $        IF LL .LE. 5 THEN GOTO LOOPT
>> $    ELSE    ! this else goes with the original "IF" not the one above it
>> $       IF LL .GT. 5 THEN LL=0   ! this line will only get executed
>> when the original "if" is "false"
>> $ ENDIF
>>
> 
> I simplified it to:
> 
> $FIND_TCODE: !Gosub
> $ LL=5
> $LOOPT:
> $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
> $ THEN
> $ LL=LL+1
> $ show sym ll
> $  IF LL .GT. 5
> $  THEN
> $   LL=0
> $  ELSE
> $   GOTO LOOPT
> $  ENDIF
> $ ENDIF
> $ show sym ll
> $ RDESC=F$ELEMENT(LL,",",TDESC)
> $ RETURN
> 
> It was redundent to check for ".GT. 5" and also
> ".LE. 5" for if not one then of course the other.
> 
> The crux of the problem is that within an
> $IF <condition_1>
> $THEN
> $<statement_t1>
> $<statement_t2>
> $ELSE
> $<statement_e1>
> $<statement_e2>
> $ENDIF
> 
> that
> $<statement_pn>
> should be able to be the (valid) statement
>   $IF <condition_x> then <statement_y>
> 
> and that in the complex IF-THEN-ELSE the
> "$THEN"
> must be on it's own line to distinguish
> between the two forms.
> 
> Probably if I had put a replacement statement
> before the $ELSE the parser would have recovered.
> 
> It's better this way, however.
> 
> -Norm
> 
>> Ken
>>
>>
>>
>> >
>> > And no, TDESC should be TDESC.  It matches the code in one
>> > element table and move the description from another
>> > element table, but that's not relevent and since I didn't
>> > include that part of the procedure, you can't know that.
>> >
>> >
>> >
>> > >
>> >  > Try:
>> >  >
>> >  > $FIND_TCODE: !Gosub
>> >  > $ LL=5
>> >  > $LOOPT:
>> >  > $ IF FCODE .NES. F$ELEMENT(LL,",",TCODE)
>> >  > $  THEN
>> >  > $    LL=LL+1
>> >  > $    show sym ll
>> >  > $    IF LL .LE. 5 THEN GOTO LOOPT
>> >  > $ endif
>> >  > $ IF LL .GT. 5 THEN LL=0
>> >  > $ show sym ll
>> >  > $ RDESC=F$ELEMENT(LL,",",Tcode)
>> >  > $ sho sym rdesc
>> >  > $ RETURN
>> >  >
>> >  > Ken
>> >


$IF <condition_x> then <statement_y> is a single line conditional.
It does not involve or allow ELSE or ENDIF
there is no $IF <condition_x> then <statement_y> else <statement_z>

IF-then-else has to be multiple line.
AND the number of endif statements have to balance the IF statements

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

Date: 12 Nov 2007 07:34:28 -0600
From: koehler@eisner.nospam.encompasserve.org (Bob Koehler)
Subject: Re: VAX, VMS and QBUS Devices
Message-ID: <IA6nh60cPFL4@eisner.encompasserve.org>

In article <5pmcv7Fs09frU1@mid.individual.net>, billg999@cs.uofs.edu (Bill Gunshannon) writes:
> OK, here's a quastion that may seem rather strange, but I am serious.
> If I put a QBUS extender on a VAX 4000-100 can I put an RXV11 on it?
> Will VMS recognize it and allow access to RX01/RX02 disks?  And, lastly,
> if this will actually work, can VMS recognize and read any PDP-11 formats?

   As far as the hardware question:  I think so, but maybe someone who
   knows will pipe in.  Check the I/O user's guide to see of the RXV11
   is a recognised driver (I think it is).

   Files-11 ODS-1 is a common native format for RSX-11 on your PDP-11 and
   VMS on your VAX (but not on Alpha or IA-64).

   If the PDP-11 disk is not Files-11, it may be one of the formats
   recognised by the VMS EXCHANGE utility (RT-11 or DOS (DEC's DOS, not 
   MS-DOS), which will let you initialize disks in those formats and 
   exchange files between those and native format disks.

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

Date: 12 Nov 2007 13:38:36 GMT
From: billg999@cs.uofs.edu (Bill Gunshannon)
Subject: Re: VAX, VMS and QBUS Devices
Message-ID: <5pr3asFsdjbdU1@mid.individual.net>

In article <IA6nh60cPFL4@eisner.encompasserve.org>,
	koehler@eisner.nospam.encompasserve.org (Bob Koehler) writes:
> In article <5pmcv7Fs09frU1@mid.individual.net>, billg999@cs.uofs.edu (Bill Gunshannon) writes:
>> OK, here's a quastion that may seem rather strange, but I am serious.
>> If I put a QBUS extender on a VAX 4000-100 can I put an RXV11 on it?
>> Will VMS recognize it and allow access to RX01/RX02 disks?  And, lastly,
>> if this will actually work, can VMS recognize and read any PDP-11 formats?
> 
>    As far as the hardware question:  I think so, but maybe someone who
>    knows will pipe in.  Check the I/O user's guide to see of the RXV11
>    is a recognised driver (I think it is).
> 
>    Files-11 ODS-1 is a common native format for RSX-11 on your PDP-11 and
>    VMS on your VAX (but not on Alpha or IA-64).
> 
>    If the PDP-11 disk is not Files-11, it may be one of the formats
>    recognised by the VMS EXCHANGE utility (RT-11 or DOS (DEC's DOS, not 
>    MS-DOS), which will let you initialize disks in those formats and 
>    exchange files between those and native format disks.
> 

Thank you.  Time to revive another old system.  

bill

-- 
Bill Gunshannon          |  de-moc-ra-cy (di mok' ra see) n.  Three wolves
bill@cs.scranton.edu     |  and a sheep voting on what's for dinner.
University of Scranton   |
Scranton, Pennsylvania   |         #include <std.disclaimer.h>   

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

End of INFO-VAX 2007.620
************************