AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to Computer Support/Help/Discussion...  <--  <--- Return to Home Page
   Networked Database  Computer Support/Help/Discussion...   [117 / 1628] RSS
 From   To   Subject   Date/Time 
Message   Sean Dennis    All   Some programming help   July 4, 2019
 12:40 PM *  

Hello All,

I am trying to write a procedure in TP that will display a text string in 
random colors except that the color selection is only run once.  I know it's a 
logic error but I can't seem to see it with my own eyes.  This is for my 
doorkit so there's some proprietary commands in here but this is what I have 
so far:

{ -------------------------------------------------------------------
  PROCEDURE SRFColor (S: String);
  Displays a text string in random colors
  ------------------------------------------------------------------- }
Procedure SRFColor(S : String);
Var
  SLen : Byte Absolute S;
  N, X : Integer;
Begin
  For N := 1 To SLen Do
    Begin
      Repeat
        Randomize;
        X := Random(15);
      Until ( X >= 1);
      If Loc Then
        Begin
          TextColor(X);
          Write(S[N]);
        End
      Else
        Begin
          fk_Textforeground(X);
          fk_Write(S[N]);
        End;
    End;
  NL;
End;

I think it's the "X := Random(15)" line that isn't right.

Any help is appreciated.

Later,
Sean

... If at first you don't succeed, you're doing about average.
--- GoldED+/LNX 1.1.5-b20180707
 * Origin: Outpost BBS * Limestone, TN, USA (618:618/1)
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to Computer Support/Help/Discussion...  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0148 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.1.241108