Universe: Is there a way to tell if a SELECT Channel is active?

77 views
Skip to first unread message

George Gallen

unread,
Feb 22, 2018, 10:27:12 AM2/22/18
to mvd...@googlegroups.com

I'm putting together a subroutine that needs to do it's own SELECT TO / READNEXT FROM


usually, I just use channel 6 - but wanted to put together another subroutine that would

return all active channels (basically loop through the 10 channels and determine if it's active)


The problem is if there is an active READNEXT going on, and you execute a new SELECT using the existing active channel, you clobber the existing position.


Example SYSTEM(11) will return a 1 if select list 0 is active -

I didn't see any SYSTEM() calls to check channels other than 0

I tried adding the channel # as the second parameter like SYSTEM(11,4) but it seems to be ignored an only checks channel 0


Thanks




Steve Johnson

unread,
Feb 22, 2018, 10:42:37 AM2/22/18
to mvd...@googlegroups.com
SELECTINFO( ListNum, 1 ) will return 1 if ListNum is active. Works on U2 and Caché.

Best regards,
Stephen Johnson
Progenixx, Inc.

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms

George Gallen

unread,
Feb 22, 2018, 10:47:13 AM2/22/18
to mvd...@googlegroups.com

How did I miss that one?  Looks like it time for new glasses.....


Thanks



From: sfs...@gmail.com <sfs...@gmail.com> on behalf of Steve Johnson <ste...@progenixx.com>
Sent: Thursday, February 22, 2018 10:42 AM
To: mvd...@googlegroups.com
Subject: Re: [mvdbms] Universe: Is there a way to tell if a SELECT Channel is active?
 
To unsubscribe, email to: mvdbms+un...@googlegroups.com

George Gallen

unread,
Feb 22, 2018, 11:52:07 AM2/22/18
to mvd...@googlegroups.com

Just in case anybody needs this.....


usage:


CALL *FIRST.CHANNEL(CHANNELNO)

CMD="SELECT VOC SAMPLE 10 TO ":CHANNELNO

EXECUTE CMD RTNLIST CAPTURING JUNK

LOOP

    READNEXT ID FROM CHANNELNO ELSE EXIT

    ....

REPEAT



SUBROUTINE FIRST.CHANNEL(FIRST)   ---- I chose to globally catalog this subroutine
*
   FIRST=""
   CHANNELS=""
*
   FOR T=0 TO 10
      IF SELECTINFO(T,1)=0 THEN CHANNELS<T+1>=1 ELSE CHANNELS<T+1>=0
   NEXT T
   FOR T=1 TO DCOUNT(CHANNELS,CHAR(254))
      IF CHANNELS<T>=1 THEN FIRST=T-1 ; EXIT
   NEXT T
*
   RETURN
STOP
END




From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of George Gallen <g_ga...@hotmail.com>
Sent: Thursday, February 22, 2018 10:27 AM
To: mvd...@googlegroups.com
Subject: [mvdbms] Universe: Is there a way to tell if a SELECT Channel is active?
 

Steve Trimble

unread,
Feb 22, 2018, 12:23:59 PM2/22/18
to mvd...@googlegroups.com
george
can you say:
SELECT TO MYLIST instead of a 'numbered' list
I normally use the named list to keep it special within the subroutine, etc

then:
READNEXT ID FROM MYLIST ELSE EXIT....

Computerized Data Mgmt Inc
Steve Trimble
(501) 615-8674 office
(501) 772-3450 cell / text

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

George Gallen

unread,
Feb 22, 2018, 4:13:18 PM2/22/18
to mvd...@googlegroups.com

Doesn't look like Universe likes that on.


SELECT filename TO MYLIST   cause an error on Universe.  From the TCL you can use a number from 0 to 99

however, in Basic you can only reference 0 to 10  (so it says) - although I haven't tried higher than 10


George



From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of Steve Trimble <cdm...@gmail.com>
Sent: Thursday, February 22, 2018 12:23 PM
To: mvd...@googlegroups.com
Subject: Re: [mvdbms] Universe: Is there a way to tell if a SELECT Channel is active?
 
To unsubscribe, email to: mvdbms+un...@googlegroups.com

George Gallen

unread,
Feb 22, 2018, 4:18:33 PM2/22/18
to mvd...@googlegroups.com

Not sure now where I saw list# from 0 to 99 for Universe - but even at the TCL you can only

use 0 to 10, same as with basic.


George



From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of George Gallen <g_ga...@hotmail.com>
Sent: Thursday, February 22, 2018 4:13 PM

Steve Trimble

unread,
Feb 22, 2018, 5:47:50 PM2/22/18
to mvd...@googlegroups.com
George - I am not familiar with Universe, but QM uses: SELECTE or SELECTV TO VARIABLE.NAME where as mvBASE and D3 use: SELECT TO VARIABLE.NAME

Computerized Data Mgmt Inc
Steve Trimble
(501) 615-8674 office
(501) 772-3450 cell / text

Ed Clark

unread,
Feb 22, 2018, 6:01:50 PM2/22/18
to mvd...@googlegroups.com
Depending on the flavor of universe, $OPTIONS VAR.SELECT is on or off by default.
When VAR.SELECT is on, SELECT acts like SELECTV and saves to a local list variable.
When VAR.SELECT is off, SELECT acts like SELECTN and saves to a numbered list.
You can explicitly use SELECTN or SELECTV as needed.
SELECTE always saves list 0 to a local list variable.

To unsubscribe, email to: mvdbms+un...@googlegroups.com

Martin Phillips

unread,
Feb 23, 2018, 4:36:08 AM2/23/18
to mvd...@googlegroups.com

This thread seems to have started in UniVerse and now drifted to QM.

 

QM has the same approach to select lists as UV, supporting both the numbered lists (as originated by Prime Information) and the Pick style select list variables. These are provided by the SELECTN and SELECTV statements and, just like UV, we have a compiler directive, $MODE SELECTV, that controls which style is used by SELECT. Rather than putting this in every program, it can go in the $BASIC.OPTIONS record to simplify things.

 

 

Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

--

George Gallen

unread,
Feb 23, 2018, 11:33:12 AM2/23/18
to mvd...@googlegroups.com

these are only for use for non filtered SELECTs. If you need to filter your select you have to use EXECUTE with the RTNLIST clause ,

   which (at least in UV), TCL does not support named lists - only channels 0-10. 


By filtered I mean using the WITH clause or sorting using the BY clause of the SELECT.


George




From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of Martin Phillips <martinp...@ladybridge.com>
Sent: Friday, February 23, 2018 4:36 AM
To: mvd...@googlegroups.com
Subject: RE: [mvdbms] Universe: Is there a way to tell if a SELECT Channel is active?
 

Steve Trimble

unread,
Feb 23, 2018, 11:39:43 AM2/23/18
to mvd...@googlegroups.com
OPEN \WORK\ TO WK.FL ELSE STOP 201,\WORK\
SELECTV WK.FL TO WKIDLIST
READNEXT WK.ID FROM WKIDLIST ELSE EXIT
.....

VERB = \SSELECT TM BY TITLE BY AUTHOR\
EXECUTE VERB CAPTURING RESULT RETURNING ERRINFO
SELECTE TO TMIDLIST
READNEXT TM.ID FROM TMIDLIST ELSE EXIT
....

Computerized Data Mgmt Inc
Steve Trimble
(501) 615-8674 office
(501) 772-3450 cell / text

--

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

 

--

You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

 

--

You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com

To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+unsubscribe@googlegroups.com

George Gallen

unread,
Feb 23, 2018, 12:08:41 PM2/23/18
to mvd...@googlegroups.com

I'll have to try this with UV. I've always used the RTNLIST Clause and skipped right to the READNEXT loop.


George



Sent: Friday, February 23, 2018 11:39 AM
To unsubscribe, email to: mvdbms+un...@googlegroups.com

George Gallen

unread,
Feb 23, 2018, 1:03:15 PM2/23/18
to mvd...@googlegroups.com

in reading the help for SELECTE on UV - it allows you use the name in place of channel 0.


That being said...it does appear that when you use SELECTE to transfer to the variable name it

   releases channel 0 - so a subsequent SELECT to channel 0 does not clobber the placeholder

   within the variable the first SELECTE assigned to.


I never tried nesting these variants prior - and appears you can nest them without corruption.


Thanks

George




Sent: Friday, February 23, 2018 12:08 PM
Reply all
Reply to author
Forward
0 new messages