David J Murray Dev
~ Learn and Do - Excel and Share ~

Random background in SBClient

Aug 17, 2006
You're Reading: Random background in SBClient

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

About the Author

<a href="https://davidjmurray.dev/losucag/davidjmurray/" target="_self">djm</a>

djm

I have been in the computer/IT industry for over 35 years. After spending half a life-time in highly proprietary database environments, I have succumbed to the WordPress Eco-system and I'm well down the chasm. I am specializing in AWS hosting, Wordpress CMS, Elegant Themes, in particular Divi and Extra themes.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This