MMCC MASTHEAD
Mid-Michigan Computer Consultants - Bay City, Michigan
 


CONTENTS       (old style)
Mid-Michigan Computer Consultants
509 Center
Bay City, Michigan

Sales (989) 892-9242
Support (989) 686-8860

Plb-0309.cfm v1.0


plb-t010.cfm
 

ANSI Standard PL/B Language and Visual PL/B

CPU TIME and WINDOWS
PLB-0390 - Rev 07/29/2020 18:30

NOTE TO OUR READERS
This web resource is written for our own use. But we feel strongly that the PL/B language should be shared with the software community. So feel free to use this at will! BUT PLEASE... if you find errors or omissions or have a better way to do something. TELL US! Dialog helps us all. Send e-mail to: support@mmcctech.com
Some quick notes on INITs and Literals.

Example of COMMON code
Must appear first in a code unit.
.
USERSYS  DIM       *4   User's internal system/company ID
USERID   DIM       *20  User's external ID     (was USERNAME)
USERSUPR DIM       *3   User's supervisor code (was USERID)
USERPW   DIM       *5   User's password (not big enough! - too bad)
USERLEV  DIM       *2   Security level
.


Example of HEX VARIABLE code
.......................
.
LOWVAL   INIT      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00:
                   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
HIGHVAL  INIT      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF:
                   0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
				   
.
FIX_HEX_7F     INIT   0x7F," ",0x0C," ",0x0D," ",0x25," "
FIX_HEX_0A     INIT   0x0A," "     ;1/10/2011  (see ROTX0816)
FIX_HEX_0D     INIT   0x0D," "     ;7/18/2012  (see ODAXCI10 / ZZLIST)
FIX_HEX_09     INIT   0x09,"^"     ;4/03/2010  (see MMCCVIEW)
.   Above is replace string to kill any type of return in a string
HEX_SPLITTER   INIT   0x7F    ;Base value for SPLIT_ON_7F    9/24/05
HEX_7F         INIT   0x7F    ;Return for ALERTS and EDIT TEXTS
HEX_0C         INIT   0x0C    ;Form Feed
HEX_0A         INIT   0x0A    ;5/27/07
HEX_0D         INIT   0x0D
HEX_0D0A       INIT   0x0D,0x0A          ; 7/18/2012
HEX_25         INIT   0x25
HEX_09         INIT   0x09  Tab character
TAB            INIT   0x09  Tab character
.				   


Example of NUMERIC VARIABLE code
.
OLDVAL   FORM      4.2            ; total of 7 bytes
NEWVAL   FORM      4.4            ; total of 9 bytes
.
ARBAL    FORM      "    4.50"     ; total of 7 bytes
.
MAXLINE  FORM      "55"           ; total of 2 bytes
LINECNT  FORM      2              ; total of 2 bytes
.


#EXAMP_44 FORM	4.4               ; total of 9 bytes
#EXAMP_4A FORM  "   1.34"         ; total of 7 bytes
#EXAMP_4B FORM  "   2.5678"       ; total of 9 bytes
.               "1234.1234"
         WINSHOW
         DISPLAY   *RPTCHAR="_":80:
         	   *N,"Examples from UTILPLB9\TESTPACK.PLS:":
         	   *N,"EXAMP_44  FORM 4.4:",           *HON,*LL,#EXAMP_44,*PL,*HOFF:
         	   *N,"EXAMP_4A  FORM "   1.34":",     *HON,*LL,#EXAMP_4A,*PL,*HOFF:
         	   *N,"EXAMP_4B  FORM "   2.5678":",   *HON,*LL,#EXAMP_4B,*PL,*HOFF:        	   
         	   *N


Example of code


















Example of code












Example of STRING VARIABLE code
YYMMDD   DIM       6
MMDDYY   DIM       6
MM       DIM       2
DD       DIM       2
CC       DIM       2       Century work (18 for 1800s)
YY       DIM       2
HRS      DIM       2       ;Added 9/12/2002
MIN      DIM       2       ;Added 9/12/2002
SEC      DIM       2       ;Added 9/12/2002
CCYY     DIM       4
CENTURY  INIT      "N"     Get century in DATEENTR?
NINEDATE INIT      "999999"
DATEOK   DIM       1       Date checked OK by DATEENTR routine
DATECHEK INIT      "Y"     Y or N to test date in DATEENTR routine

SPACE    INIT      " "
...                .123456789.123456789.123456789.123456789.123456789.
SPACES   INIT      "                                                  ":
                   "                                                  ":
                   "                                                  ":
                   "                                                  ":
                   "                                                  ":
       


Example of INITIALIZED ARRAY code
.
...............................
.   USSTATES                                    1/19/99
.                  Standard STATE LOOKUP
.             For WINDOWS just define the table
.
.                     123456789.123456789.123456789.123456789.12345
US_STATES_LIST INIT  "AL,AK,AZ,AR,CA,CO,CT,DE,FL,GA,HI,ID,IL,IN,IA,":
                     "KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NB,NV,NH,NJ,":
                     "NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,":
                     "VA,WA,WV,WI,WY,"
.
US_STATE_ID    DIM  2(50),("AL"), ("AK"), ("AZ"), ("AR"), ("CA"):
                          ("CO"), ("CT"), ("DE"), ("FL"), ("GA"):
                          ("HI"), ("ID"), ("IL"), ("IN"), ("IA"):
                          ("KS"), ("KY"), ("LA"), ("ME"), ("MD"):
                          ("MA"), ("MI"), ("MN"), ("MS"), ("MO"):
                          ("MT"), ("NB"), ("NV"), ("NH"), ("NJ"):
                          ("NM"), ("NY"), ("NC"), ("ND"), ("OH"):
                          ("OK"), ("OR"), ("PA"), ("RI"), ("SC"):
                          ("SD"), ("TN"), ("TX"), ("UT"), ("VT"):
                          ("VA"), ("WA"), ("WV"), ("WI"), ("WY")
.
US_STATE_NAME  DIM 20(50),("Alabama"),("Alaska"),       ("Arizona"):
                     ("Arkansas"),    ("California"),   ("Colorado"):
                     ("Connecticut"), ("Deleware"),     ("Florida"):
                     ("Georgia"),     ("Hawaii"),       ("Idaho"):
                     ("Illonis"),     ("Indiana"),      ("Iowa"):
                     ("Kansas"),      ("Kentucky"),     ("Louisiana"):
                     ("Maine"),       ("Maryland"),     ("Massachusetts"):
                     ("Michigan"),    ("Minnesota"),    ("Mississippi"):
                     ("Missouri"),    ("Montana"),      ("Nebraska"):
                     ("Nevada"),      ("New Hampshire"),("New Jersey"):
                     ("New Mexico"),  ("New York"),     ("N. Carolina"):
                     ("N. Dakota"),   ("Ohio"),         ("Oklahoma"):
                     ("Oregon"),      ("Pennsylvania"), ("Rhode Island"):
                     ("S. Carolina"), ("S. Dakota"),    ("Tennessee"):
                     ("Texas"),       ("Utah"),         ("Vermont"):
                     ("Virginia"),    ("Washington"),   ("W. Virginia"):
                     ("Wisconsin"),   ("Wyoming")
.
US_STATE_MAX   FORM   "50"



Write to MMCC Technical Support at:               Send e-mail to MMCC.
MMCC - Technical Support
600 W. Midland
Bay City, MI 48708
(989) 686-8860
© 1997 - 2020 MMCC - All Rights Reserved