bug-gtypist
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gtypist] Crash in Long QWERTY course in lesson R5


From: Tim Marston
Subject: Re: [bug-gtypist] Crash in Long QWERTY course in lesson R5
Date: Sun, 18 Aug 2013 14:00:13 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Sat, Aug 17, 2013 at 06:51:54PM +0200, Felix Natter wrote:
> >  b) How to get back to where they were.  E.g.:
> >
> >         To get back to where you were in GNU Typist, type:
> >         $ gtypist -l <LAST-LABEL>
> 
> This is more difficult. What we really need for a general solution is
> something like this:
> 
>   $ gtypist x.typ -l <LABEL>

Can't we do this, though?  We can just use cl_start_label (the script
specified on the command line or NULL, from gtypist.c) and __last_label
(the last visited label, from script.c).

The only problem with this idea is that the banner is only set once, at
the start of each lesson.  So, for example, the start of the Q lesson
looks like this:

  
#------------------------------------------------------------------------------
  # Lesson Q1
  
#------------------------------------------------------------------------------
  *:Q1
  *:_Q_S_Q1
  B:                             Lesson Q1
  
  *:_Q_R_L0
  T:          Welcome to lesson Q1.
   :
   :In the Q series of lessons, we will be learning to touch-type on the 
standard
   :keyboard.  I will introduce you to each letter on the keyboard, one at a 
time.
   :By the time you have completed this series, you will be able to type the 
entire
   :alphabet, the numbers, and most of the punctuation keys by touch.
   :
  [snip]

So, starting at Q1 or _Q_S_Q1 would show the banner and then move on to
the lesson.  But starting at _Q_R_L0, _Q_R_L1 (not shown above),
_Q_R_L2, etc., *doesn't* show the banner.

One way to work around this that comes to mind would be to change the
tools/typcombine awk-script so that it inserts a repeat of the last
banner command after every label (or consecutive set of labels).  So,
it'd look like this:

  
#------------------------------------------------------------------------------
  # Lesson Q1
  
#------------------------------------------------------------------------------
  *:Q1
  *:_Q_S_Q1
  B:                             Lesson Q1
  
  *:_Q_R_L0
  B:                             Lesson Q1
  T:          Welcome to lesson Q1.
   :
   :In the Q series of lessons, we will be learning to touch-type on the 
standard
   :keyboard.  I will introduce you to each letter on the keyboard, one at a 
time.
   :By the time you have completed this series, you will be able to type the 
entire
   :alphabet, the numbers, and most of the punctuation keys by touch.
   :
  [snip]

And the banner would also be inserted again after _Q_R_L1, _Q_R_L2,
etc.  This would only fix it for gtypist.typ, though.

Another solution that comes to mind is that we could scan the script
for banners (much like we do for labels) so that we always know which
banner occurs before which label.  Then display that.  This would work
for all scripts, obviously.

The problem with both these solutions is that they won't work for all
scripts.  For example:

  B:Welcome
  T:This script sets the banner to "Welcome" for this message and then
   :"Test script" for the remainder of the script.  If we used either
   :of the solutions above, though, and started at LABEL1 or LABEL2, it
   :would say "Welcome" during those drills, since it is the last
   :banner before these labels.
  G:MENU
  
  *:LABEL1
  D:test lesson 1
  X:
  
  *:LABEL2
  D:test lesson 2
  X:
  
  *:MENU
  B:Test script
  M: "Select one of the following"
   :LABEL1 "Do test lesson 1"
   :LABEL2 "Do test lesson 2"

I bet there are other situations where it would break, as well (the
banner command also clears the screen, for example).

-- 
Tim Marston
ed.am



reply via email to

[Prev in Thread] Current Thread [Next in Thread]