Go to:  Site entry | Site contents | Site index | Internet | HTMLScript | Text bottom

Random  Tagline  Sample  HTMLScript

RANDOM script generates a random tagline selected from a predefined list contained within script text.  This integration of code and data being processed is made here for the sake of a quick response.  Ideally a cycle of purely random attempts should work until a new tagline index is selected, which is not presented in the history of previously generated indexes.  However, with this approach response time tends to be more than is acceptable.  To keep the response time always within reasonable limits the following approach was chosen after a number of experiments:

Notes: Entire HTMLScript code is placed between </HEAD> and <BODY> tags.
HTMLScript line right above <BODY> tag selects table and screen background at random out of 9 opportunities.


<!-- Random Tagline Sample  04/21/1998–02/11/1999 -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- DAVAR/MISCL/TAGLINES/RANDOM.HTS              -->
<!-- Copyright (C) 1998–1999 by Vladimir Veytsel  -->

<HTML>
<HEAD>
  <TITLE>Random Tagline (Miscellaneous Selection at Davar Web Site)</TITLE>
  <META NAME   = Description
        CONTENT   ="Computer Science, Programming, Mainframe, UNIX, PC, Internet,
                 Mathematics, Go, Zen, Quotations, Extracts, Humor, Russian">
  <META NAME   = Keywords
        CONTENT   ="Davar Web Site, Tagline, Taglines, Random">
  <META NAME=Author CONTENT   ="Vladimir Veytsel">
  <LINK REV =Made   HREF   ="mailto:nobody@nowhere.net">
</HEAD>

<LET T1 ="A man is known <BR> by the silence he keeps...%">
<LET T2 ="All things are difficult <BR> before they are easy.%">
<LET T3 ="Better to understand a little <BR> than to misunderstand a lot.%">
<LET T4 ="Beware of a half truth; <BR> you may be getting <BR> the wrong half.%">
<LET T5 ="Doing it the hard way <BR> is always easier.%">
<LET T6 ="Don't let your <BR> superiors know <BR> you're superior to them.%">
<LET T7 ="Don't listen to what they say, <BR> watch what they do!%">
<LET T8 ="Eternal vigilance <BR> is the price of freedom.%">
<LET T9 ="From listening <BR> comes wisdom, <BR> from speaking, <BR> repentance.%">
<LET T10="He who is good <BR> for making excuses, <BR> is seldom good <BR> for anything else.%">
<LET T11="I saw what you did <BR> and I know who you are.%">
<LET T12="If everything's coming <BR> your way, <BR> you're in the wrong lane.%">
<LET T13="If you don't stand <BR> for something, <BR> you'll fall <BR> for anything.%">
<LET T14="If you trade freedom <BR> for security, <BR> you get neither.%">
<LET T15="Liberty is from God. <BR> Liberties, from the devil.%">
<LET T16="Men fight for freedom, <BR> then pass laws <BR> to take it away.%">
<LET T17="Never argue with a fool - <BR> people might not know <BR> the difference.%">
<LET T18="Patience and time do more <BR> than strength or passion.%">
<LET T19="Professionals built <BR> the Titanic. <BR> Amateurs built the Ark.%">
<LET T20="Small is beautiful.%">
<LET T21="Spare yourself <BR> many hard falls; <BR> don't jump <BR> to conclusions.%">
<LET T22="The best lessons <BR> are learned by doing, <BR> or at least trying.%">
<LET T23="The best solution <BR> uses the fewest <BR> assumptions.%">
<LET T24="The best way to save face <BR> is to keep the lower part shut.%">
<LET T25="The scenery only changes <BR> for the lead dog.%">
<LET T26="Those who won't think <BR> will have it done for them.%">
<LET T27="Watch where you go... <BR> remember where <BR> you've been...%">
<LET T28="We are not beaten <BR> when we loose, <BR> we're beaten <BR> when we quit.%">
<LET T29="What you don't do <BR> is always more important <BR> than what you do do.%">
<LET T30="Whenever anyone promises <BR> heaven on earth, <BR> expect hell.%">
<LET T31="Wisdom is knowing <BR> when to avoid perfection.%">
<LET T32="You can't win. <BR> You can't break even. <BR> You can't even quit the game.%">

<LET Total=32>   <!-- Current total number of taglines in the above list -->

<!-- Get next tagline index (non-repeatable for previous 8)   -->
<!-- (logic below is necessary to minimize the response time) -->

<LET Cnt=Total>  <!-- Attempts reverse counter            -->
<LET K=Cnt/4*3>  <!-- Number of purely random attempts    -->
<LET L=Cnt/4>    <!-- Number of "+1" incremental attempts -->
<LET Valid=0>    <!-- Index valid (non-repeatable) flag   -->

<WHILE Valid EQ 0>  <!-- Repeat until valid index is generated -->
  <IF Cnt GE K>  <!-- Attempts counter is within "random" range -->
      <LET I=((dyn_tm_min*dyn_tm_sec) MOD Total)+1>  <!-- Get index at random -->
  </IF>
  <IF Cnt LT L>  <!-- Attempts counter is within "incremental" range -->
      <LET I=((I+1) MOD Total)+1>  <!-- Get "+1" incremental after previous -->
  </IF>
  <LET J=1>       <!-- "arg1" is HTMLScript name, parameters start with "arg2" -->
  <WHILE J LE 9>  <!-- Compare new index with 8 previously saved as arguments  -->
    <LET J=J+1>
    <IF arg&[J] EQ I>
        <LET Found=1>  <!-- Index is found among 8 previously saved -->
    </IF>
  </WHILE>
  <IF Found EQ 0>
      <LET Valid=1>  <!-- New index is valid (not among 8 previous) -->
  </IF>
  <LET Cnt=Cnt-1>  <!-- Decrement the attempts reverse counter -->
  <IF Cnt LE 0>    <!-- Limit number of attempts to number of taglines -->
      <LET I=Total/2>
      <IF "&[arg2]" NE "">
        <LET I=((&[arg2]+1) MOD Total)+1>  <!-- Get next sequential index -->
      </IF>                                <!-- to previously displayed   -->
      <LET Valid=1>
  </IF>
</WHILE>

<LET J=("%" IN T&[I])-2>              <!-- Get tagline text length - 1 -->
<LET Letter=(T&[I] SUBSTR "1,1")>     <!-- Get tagline first letter    -->
<LET Text  =(T&[I] SUBSTR "2,&[J]")>  <!-- Get tagline remaining text  -->

<LET J=((dyn_tm_min*dyn_tm_sec) MOD 9)+1>
<BODY BACKGROUND="../../PAPER&[J]00.JPG" BGCOLOR=White TEXT=Black LINK=Blue ALINK=Fuchsia VLINK=Purple>
<FONT FACE="Times New Roman" SIZE=3>
  <CENTER>
  <!--
  Arguments (1–9): "&[arg1]" "&[arg2]" "&[arg3]" "&[arg4]" "&[arg5]" "&[arg6]" "&[arg7]" "&[arg8]" "&[arg9]"<BR>
  -->
    <I>
      <!-- Get next random tagline link (saves history as argument queue) -->
      <BLINK><FONT COLOR=Red><B>Next</B></FONT></BLINK>
      <A HREF="RANDOM.HTS?&[I]+&[arg2]+&[arg3]+&[arg4]+&[arg5]+&[arg6]+&[arg7]+&[arg8]">
         <BR>Random tagline sample
      </A>
      <BR> 
      <TABLE BORDER=5 BACKGROUND="../../PAPER0&[J]0.JPG">
        <TR><TD><CENTER><I><FONT SIZE=7 COLOR=Red><B> &[Letter]</B></FONT>
                           <FONT SIZE=7>&[Text]</FONT>
                        </I>
                </CENTER>
            </TD>
        </TR>
      </TABLE>
      <BR>
      <FONT COLOR=Green>Go to:</FONT>  <A HREF="../../index.htm">Davar site entry</A>
      <FONT COLOR=Green>|</FONT> <A HREF="../../DIRECT.HTM">Site contents</A>
      <FONT COLOR=Green>|</FONT> <A HREF="../../INDEX.HTM">Site index</A>
      <FONT COLOR=Green>|</FONT> <A HREF="../MISCL.HTM">Miscellaneous</A>
      <FONT COLOR=Green>|</FONT> <A HREF="TAGLINES.HTM">Tagline selection</A>
    </I>
  </CENTER>
</FONT>
</BODY>
</HTML>
  

View Random Tagline Sample   (Use [Back] button or [Alt]+[CL] to return here)
View [and save] RANDOM.TXT text   (Use [Back] button or [Alt]+[CL] to return here)
To make text executable rename it to *.HTS and make a global change of "&lt;" to "<" signs.
Go to:  Site entry | Site contents | Site index | Internet | HTMLScript | Text top