Subject Re: Eliminate a character in a field
From Mervyn Bick <invalid@invalid.invalid>
Date Sun, 11 Sep 2022 09:55:24 +0200
Newsgroups dbase.getting-started

On 2022/09/10 21:47, Mervyn Bick wrote:

> Untested but the following should sort out the entire table. Make a back
> up first.
>
>
> use tablename
> scan
> fldname = stuff(fldname,3,1,'')
> endscan
> use

Oops.  All that will do is place the revised string in a memory variable
named fldname as many times as there are records. :-(

This was done in a hurry last night as the power was due to be cut off
at 22:00 for 2 hours.  Immediately after posting the message I shut down
the computer.   By the time I had realised that there was an error there
wasn't enough time to reboot and post a correction.

It's a long story but South Africa has an inadequate supply of
electricity.  Skimping on preventative maintenance over the years has
resulted in plant being totally unreliable and breakdowns are a regular
occurrence. Eskom, our national supplier, has instituted a system of
rolling blackouts to keep the grid from collapsing completely.  It lends
new meaning to the term "Darkest Africa". :-(

Our schedule for load shedding depends on how much plant has failed at
any given time but the slots in our area for yesterday and tomorrow are
06:00 - 08:30, 14:00 - 16:30 and 22:00 - 00:30.


The code should have been

use tablename
scan
replace fldname with stuff(fldname,3,1,'')
endscan
use


Mervyn.