; CHAP1.ACT ; Chapter 1 program from ; _MUX=Window_Programming_ ; By Bill Kendrick, (c) NBS 1995 ; This program opens a connection, and displays information about the ; Window Server. ; Include the MUX-Window routines ; Single machine: INCLUDE "MUXLESSW.ACT" ; MUX network: ;INCLUDE "MUXW.ACT" ; Waits for a key on the Application Client's console Proc WaitKey() Byte Key=764 PrintE("(Press a key)") Key=255 Do Until Key<255 Od Key=255 Return ; Connect and show info about the connection Proc Main() Stat Z String Model(100),Ver(10),Manuf(100),Date(100) Byte B ; Connect to Window Server and tell it who and what we are If Connect("CHAP1","Demo")=FAILURE Then PrintE("Can't connect to server!") Return Fi Graphics(0) ; (Dangerous on MUXLessW) PrintE("Info:") GetModel(Model,Ver,Date,Manuf) PrintF(" Model=%S v.%S%E",Model,Ver) PrintF(" by %S%E",Manuf) PrintF(" %S%E",Date) B=GetDepth() Print(" Depth=") PrintB(B) Print(" (") If B<8 Then PrintC(1 LSH B) Else Print("256+") Fi PrintE(" colors)") ; Wait for a keypress before quitting WaitKey() Z=Disconnect() Return PROC CALLER() ; For RETURN catching... MAIN() RETURN