| Subject |
Re: Eliminate a character in a field |
| From |
Andy Taylor <andy.taylor.1959@outlook.com> |
| Date |
Sun, 11 Sep 2022 11:54:05 +0100 |
| Newsgroups |
dbase.getting-started |
Mervyn,
Nice to see you have retained your grasp of XDML. :-)
However, I'm going to do a Romain on you...
use tablename
replace all fldname with stuff(fldname,3,1,'')
use
3 lines instead of 5
chortle,
Andy
> 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.
>
>
|
|