system() calls and assign

157 views
Skip to first unread message

Ashley Chapman

unread,
May 18, 2020, 3:45:40 PM5/18/20
to Pick and MultiValue Databases
Has anybody got a comprehensive reference to the undocumented system() calls?  I'm particularly after the more obscure items and the use of "ASSIGN x TO SYSTEM(y)".

I used to use http://www.rsusers.com/cms/pages/wiki.wsp?page=112 but it's gone dark for weeks now.

Ashley

Rex Gozar

unread,
May 18, 2020, 4:16:31 PM5/18/20
to mvd...@googlegroups.com
If you are on Universe, the Universe BASIC Commands Reference
documents the SYSTEM() function. I'm not sure what you mean by
"undocumented system() calls".
> --
> 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+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/1d3cd4c8-0a92-4f1a-bd0f-a3d6e923fc87%40googlegroups.com.

dgr...@dagconsulting.com

unread,
May 18, 2020, 6:39:55 PM5/18/20
to mvd...@googlegroups.com

This is out of the UniData 8.1 UniBasic manual:

 

ASSIGN The UniBasic ASSIGN command redefines some system-level parameters. The value in option changes to the value you specify with expr.

Syntax ASSIGN expr TO SYSTEM(option)

The following table describes each parameter of the syntax.

Parameter Description

2 Page width

3 Page length

5 Page number

7 Terminal type

 

For parameters 2, 3, and 5, expr must be numeric. For parameter 7, expr must be a string representing a valid terminal type and must be enclosed in quotation marks.

Examples In the following example, the program resets the page width to 40, page length to 30, and terminal type to vt100: ASSIGN 40 TO SYSTEM(2) ASSIGN 30 TO SYSTEM(3) ASSIGN "vt100" TO SYSTEM(7)

Related commands

Language Command UniData TERM For information, see the UniData Commands Reference.

--

frosty

unread,
May 19, 2020, 12:16:44 PM5/19/20
to Pick and MultiValue Databases
On Monday, May 18, 2020 at 4:39:55 PM UTC-6, David Green wrote:

This is out of the UniData 8.1 UniBasic manual:

 

ASSIGN The UniBasic ASSIGN command redefines some system-level parameters. The value in option changes to the value you specify with expr.

Syntax ASSIGN expr TO SYSTEM(option)

The following table describes each parameter of the syntax.

Parameter Description

2 Page width

3 Page length

5 Page number

7 Terminal type

 

For parameters 2, 3, and 5, expr must be numeric. For parameter 7, expr must be a string representing a valid terminal type and must be enclosed in quotation marks.

Examples In the following example, the program resets the page width to 40, page length to 30, and terminal type to vt100: ASSIGN 40 TO SYSTEM(2) ASSIGN 30 TO SYSTEM(3) ASSIGN "vt100" TO SYSTEM(7)

Related commands

Language Command UniData TERM For information, see the UniData Commands Reference.


Cool feature I didn't know was in uniData, thank you.

Works on my version 7.1 too.

--
frosty

Ryan Ladd

unread,
May 19, 2020, 4:21:48 PM5/19/20
to Pick and MultiValue Databases
For assignment, here are ones we use often:

ASSIGN 0 TO SYSTEM(1005)           ; * turn off pagination,
ASSIGN 1 TO SYSTEM(1005)           ; * turn on pagination,

---there are others discussed on the old u2-users mail list.  I still find a bunch of info on that old mail list  of course, some of the info is from very old versoins of UV so you need to make sure things still work as they did 20 years ago :)

Here is one link to a question around system() assignments.

Rex Gozar

unread,
May 19, 2020, 4:29:08 PM5/19/20
to mvd...@googlegroups.com
The OP didn't specify the PICK flavor, but I have an INCLUDE with
predefined SYSTEM() macros for Universe:

* SYSTEM.H
* RUNTIME SYSTEM MACROS
* CVS $Revision: 1.18 $ $Date: 2019/08/30 12:14:24 $
* COPYRIGHT 2011 BY AUTOPOWER CORPORATION. ALL RIGHTS RESERVED.
******
$IFNDEF SYSTEM.H.DEFINED
$DEFINE SYSTEM.H.DEFINED 1
*
EQU SYSTEM$CALLER LIT
\(FIELD(SYSTEM(9001)<2,2>,"/",DCOUNT(SYSTEM(9001)<2,2>,"/")))\
EQU SYSTEM$HOSTNAME LIT \( UPCASE( SYSTEM(1401)<1,1,1> ) )\
EQU SYSTEM$IP.ADDRESS LIT \(SYSTEM(42))\
EQU SYSTEM$IS.PHANTOM LIT \(SYSTEM(25))\
EQU SYSTEM$IS.WINDOWS LIT \(SYSTEM(91))\
EQU SYSTEM$PROGRAM LIT
\(FIELD(SYSTEM(9001)<1,2>,"/",DCOUNT(SYSTEM(9001)<1,2>,"/")))\
EQU SYSTEM$TRACE LIT \(SYSTEM(9001))\
EQU SYSTEM$TRACE.MSG LIT \(CHAR(10):CONVERT(@FM:@VM,CHAR(10):"
",SYSTEM(9001)))\
EQU SYSTEM$UVHOME LIT "(SYSTEM(32))"
EQU SYSTEM$UVLICNO LIT "(SYSTEM(31))"
EQU SYSTEM$UVTEMP LIT "(SYSTEM(38))"
*
EQU SYSTEM$SET.DISABLE.LOGIN LIT \ASSIGN 1 TO SYSTEM(9006)\
EQU SYSTEM$SET.ENABLE.LOGIN LIT \ASSIGN 0 TO SYSTEM(9006)\
*
EQU SYSTEM$SET.DISABLE.BINARY.READ LIT \ASSIGN 0 TO SYSTEM(1017)\
EQU SYSTEM$SET.ENABLE.BINARY.READ LIT \ASSIGN 1 TO SYSTEM(1017)\
*
EQU SYSTEM$SET.USERID.PROMPT LIT \ASSIGN SYSTEM$USERID:">" TO
SYSTEM(4002)\
*
EQU SYSTEM$SET.DISABLE.PAGINATION LIT \ASSIGN 0 TO SYSTEM(1005)\
; * same as DUMMY=@(0,0)
EQU SYSTEM$SET.ENABLE.PAGINATION LIT \ASSIGN 1 TO SYSTEM(1005)\
*
* ASSIGN number TO SYSTEM(1) sets "number" printer channel active. Like
* "PRINT ON number", e.g.
* ASSIGN 5 TO SYSTEM(1) ; * set to printer chn5
* PRINT "THIS GOES TO PRINTER CHANNEL 5"
* PRINT "AS IF I DID A 'PRINT ON 5' "
* ASSIGN -1 TO SYSTEM(1); *set back to crt display
* PRINT "BACK on TERMINAL"
*
* ASSIGN number TO SYSTEM(225) changes current USERNO to number.
*
* ASSIGN number TO SYSTEM(1008) changes current printer channel width to
* "number". Use in conjunction with SYSTEM(1) to set current printer
* channel.
*
* ASSIGN number TO SYSTEM(1009) changes current printer channel depth to
* "number". Use in conjunction with SYSTEM(1) to set current printer
* channel.
*
* ASSIGN number TO SYSTEM(1010) changes current printer channel top margin
* to
* "number". Use in conjunction with SYSTEM(1) to set current printer
* channel.
*
* ASSIGN number TO SYSTEM(1011) changes current printer channel bottom
* margin
* to "number". Use in conjunction with SYSTEM(1) to set current printer
* channel.
*
* ASSIGN 1 (or 0) TO SYSTEM(1017) changes how Type1/Type19 records are
* read/written. Setting to 0 will result in all LF chars converted to @FM
* chars on reads, and @FM chars to LF chars on writes. Setting to 1 will
* result in no conversion, so reads and writes will retain LF chars.
*
* ASSIGN number TO SYSTEM(2101) results in a LIST.READU display.
*
$ENDIF
> --
> 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+un...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/4942622a-d9d8-417f-bdf6-160dd30dd588%40googlegroups.com.

Ashley Chapman

unread,
May 19, 2020, 4:29:14 PM5/19/20
to Pick and MultiValue Databases
I'm mostly saddened to see a really useful wiki page disappear, and was hoping that somebody might have an off-line copy of it.

By undocumented, I mean things like "ASSIGN 1 TO SYSTEM(999)"  which disables "Q" at the "Press... " prompt.  

It was really useful to have a curated list of all the items which covered both UV and UD.

Thanks for all the input, which is much appreciated.


On Monday, 18 May 2020 21:16:31 UTC+1, Rex Gozar wrote:
If you are on Universe, the Universe BASIC Commands Reference
documents the SYSTEM() function. I'm not sure what you mean by
"undocumented system() calls".

On Mon, May 18, 2020 at 3:45 PM Ashley Chapman <ash.c...@gmail.com> wrote:
>
> Has anybody got a comprehensive reference to the undocumented system() calls?  I'm particularly after the more obscure items and the use of "ASSIGN x TO SYSTEM(y)".
>
> I used to use http://www.rsusers.com/cms/pages/wiki.wsp?page=112 but it's gone dark for weeks now.
>
> Ashley
>
> --
> 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: mvd...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mvd...@googlegroups.com.

Ashley Chapman

unread,
May 19, 2020, 4:53:39 PM5/19/20
to Pick and MultiValue Databases
Thanks Rex, that's brilliant. :)
> To unsubscribe, email to: mvd...@googlegroups.com
> For more options, visit http://groups.google.com/group/mvdbms
> ---
> You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mvd...@googlegroups.com.

Steve Johnson

unread,
May 19, 2020, 5:20:44 PM5/19/20
to mvd...@googlegroups.com
Here are some notes that I made for UD and UV from 2005:

System() -- Undocumented Arguments

07/20/2005

  44  returns the # of processes (not seats in use)
  51  device license info for SB+
  62  value of uvconfig tunable MODFPTRS
  63  value of uvconfig tunable BLKMAX
  64  value of uvconfig tunable MAXKEYSIZE
1002  indicates if file is in rotating file pool
1003  indicates if print job is in process
1005  0 if pagination is disabled, 1 if enabled. Can ASSIGN to system(1005).
1006  indicates if cursor is at left margin
1012  page header (set with HEADING)
1017  "ASSIGN 1 to SYSTEM(1017)" In UniData the equivalent command for no conversion is "NOCONVERT [ON | OFF]". Use to read/write binary files in directories.
1022  flag for use with NLS opens
1030  parse @sentence retaining quoted literals (returns @fm delimited string), i.e THIS IS "MY TEST" on command line will be returned as THIS @fm IS @fm MY TEST ( 3 instead of 4 arguments)
1050  TRAP key array (set with KEYTRAP and documented in KEYEDIT)
1301  effective user name
1302 LISTU data, one attribute per user (not confirmed)
4001  0 for normal command line prompt (">"). Set to 1 to change the command line prompt to the value of System(4002).
4002  the replacement command line prompt, e.g., ":" instead of ">". Can be multiple chars, e.g., "DEV>". This is actually a dynamic array: <1> is the replacement string for the normal prompt; <2> for the select-list-active prompt; <3> the command continuation prompt.
9001  returns name of current subroutine -- actually name of current object path in SYSTEM(9001)<1,2>.
      The dynamic array returned contains the whole stack of object paths. Aborts if called by UO.NET.
9010  Returns database type UD, UV, UD.PE or UV.PE (udt 7.1.5 or later)

Best regards,
Stephen Johnson
Progenixx, Inc.


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

For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/16bb2af0-29f0-4868-b842-fb2d18e1ae33%40googlegroups.com.

Steve Johnson

unread,
May 19, 2020, 5:22:33 PM5/19/20
to mvd...@googlegroups.com
Some more notes:

System() Assign

4/17/2007 From Glen Herbert c. 2001:
Here are a few other ASSIGN settings that might be useable?  All the
others are for QA  debugging purposes.


ASSIGN number TO SYSTEM(1) sets "number" printer channel active.  Like
"PRINT ON number", i.e.

      ASSIGN 5 TO SYSTEM(1) ; * set to printer chn5
      PRINT "THIS GOES TO PRINTER CHANNEL 5"
      PRINT "AS IF I DID A 'PRINT ON 5' "
      ASSIGN -1 TO SYSTEM(1); *set back to crt display
      PRINT "BACK on TERMINAL"


ASSIGN number TO SYSTEM(225) changes current USERNO to number.

ASSIGN number TO SYSTEM(1008) changes current printer channel width to
"number".  Use in conjunction with SYSTEM(1) to set current printer channel.


ASSIGN number TO SYSTEM(1009) changes current printer channel depth to
"number".   Use in conjunction with SYSTEM(1) to set current printer channel.


ASSIGN number TO SYSTEM(1010) changes current printer channel top margin
to "number".   Use in conjunction with SYSTEM(1) to set current printer channel.


ASSIGN number TO SYSTEM(1011) changes current printer channel bottom
margin to "number".   Use in conjunction with SYSTEM(1) to set current printer
channel.


ASSIGN 1 (or 0) TO SYSTEM(1017) changes how Type1/Type19 records are
read/written.  Setting to 0 will result in all LF chars converted to @FM
chars on reads, and @FM chars to LF chars on writes.   Setting to 1 will
result in no conversion, so reads and writes will retain LF chars.

ASSIGN number TO SYSTEM(2101) results in a LIST.READU display.

At 06:45 PM 10/30/01, you wrote:

One that IS documented is the ability to assign to SYSTEM(3001) through
SYSTEM(3005) to fire counters for the Windows NT performance monuitor.

Best regards,
Stephen Johnson
Progenixx, Inc.

Reply all
Reply to author
Forward
0 new messages