The background to the SBClient window can be rather boring. I have in the past just set a company logo to be repeated.

But a change of scenery is as good as a holiday – so they say…

So, in the LOGIN.SETUP paragraph, I added a routine to randomly select an image.


LOCAL TILE.PIX, ICON.PIX
EQUATE EMPTY.STR TO ""
*
TILE.PIX = EMPTY.STR
ICON.PIX = EMPTY.STR
@VALUE = EMPTY.STR
EXEC "LOGIN.BMP.SEL,RANDOM"
IF (@VALUE = EMPTY.STR) OR (@RTN.FLAG # 0) THEN
*
  TILE.PIX = "S:TUBMPLOGO.BMP"
END ELSE
*
  TILE.PIX = @VALUE
END
*
ICON.PIX = "S:TUBMPICO.ICO"
*
@RTN.FLAG = SETATTR(@MAINWIN,G.TILE,TILE.PIX)
@RTN.FLAG = SETATTR(@MAINWIN,'icon',ICON.PIX)

And then the LOGIN.BMP.SEL paragraph:


LOCAL MODE, CMD, BMP.MAX
*
EQUATE EMPTY.STR TO ""
EQUATE COMMA TO ","
EQUATE SPACE TO " "
*
* Mode can be a file name or the word RANDOM
MODE = FIELD(@PARAM, COMMA, 1)
MODE = OCONV(MODE, "MCU")
*
BEGIN CASE
CASE MODE = "RANDOM" OR MODE = EMPTY.STR
*
  CMD = 'SSELECT QBMP = "LOGO]" (ARZ'
  EXEC "S:" : CMD
*
  BMP.MAX = DCOUNT(@VALUE, @AM)
  @VALUE = @VALUE;
CASE MODE # EMPTY.STR
*
  READV @VALUE FROM "QBMP", MODE,0
  IF @RTN.FLAG # 0 THEN
*
    DISP 3,MODE : " not found."
    EXIT 1
  END
CASE 1
  DISP 3, "Incorrect MODE."
  EXIT 1
END CASE
*
@VALUE = "S:TUBMP" : @VALUE
@PARAM = EMPTY.STR

where QBMP is a pointer to the SBClient BMP directory – also mapped to S:TUBMP