Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5834 > unrolled thread

Records not updated using Upper()

Started byRob van Erk <erk.v@hotmail.com>
First post2013-09-17 06:42 -0700
Last post2013-09-17 07:14 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Records not updated using Upper() Rob van Erk <erk.v@hotmail.com> - 2013-09-17 06:42 -0700
    Re: Records not updated using Upper() Karl Wochele <kw@e©os-system.dot.de> - 2013-09-17 15:53 +0200
    Re: Records not updated using Upper() Rob van Erk <erk.v@hotmail.com> - 2013-09-17 07:14 -0700

#5834 — Records not updated using Upper()

FromRob van Erk <erk.v@hotmail.com>
Date2013-09-17 06:42 -0700
SubjectRecords not updated using Upper()
Message-ID<b56d351a-0c60-4d6b-ab57-7dbce206000f@googlegroups.com>
I have a DBF with upper and lower case data in field COMPNAME. I need to uppercase all data in that field. The DBF's allows duplicate records and the index is on COMPNAME. The following code refuses to change contents of COMPNAME to uppercase for the first record

COMPNAME
========   => output:
artmcxa01  artmcxa01 
artmcxa01  ARTMCXA01
artmcxa02  artmcxa02
artmcxa02  ARTMCXA02
artmcxa03  ARTMCXA03
artmcxa04  ARTMCXA04

Why is the first record not changed to uppercase?

Code:

local sComp as string

oServer:= DSComputersImport{}
oServer:Zap()            

oServer:Appenddelimited("c:\snow\computers.csv",",") 
oServer:GoTop()

do while !oServer:EoF  
   sComp := upper(oServer:FIELDGET(#compname))
   oServer:FIELDPUT(#compname, sComp)
   oServer:Skip(1)
enddo
oServer:Close()   
 
Thanks for any advise to solve this issue.

[toc] | [next] | [standalone]


#5835

FromKarl Wochele <kw@e©os-system.dot.de>
Date2013-09-17 15:53 +0200
Message-ID<b9r563FduniU1@mid.individual.net>
In reply to#5834
Hi Rob,

you should insert oServer:Setorder(0) before oServer:gotop()
If you change the KeyValue of the current record your next skip might 
take you anywhere, even to eof() ...

HTH
Karl

Am 17.09.2013 15:42, schrieb Rob van Erk:
> I have a DBF with upper and lower case data in field COMPNAME. I need to uppercase all data in that field. The DBF's allows duplicate records and the index is on COMPNAME. The following code refuses to change contents of COMPNAME to uppercase for the first record
>
> COMPNAME
> ========   => output:
> artmcxa01  artmcxa01
> artmcxa01  ARTMCXA01
> artmcxa02  artmcxa02
> artmcxa02  ARTMCXA02
> artmcxa03  ARTMCXA03
> artmcxa04  ARTMCXA04
>
> Why is the first record not changed to uppercase?
>
> Code:
>
> local sComp as string
>
> oServer:= DSComputersImport{}
> oServer:Zap()
>
> oServer:Appenddelimited("c:\snow\computers.csv",",")
> oServer:GoTop()
>
> do while !oServer:EoF
>     sComp := upper(oServer:FIELDGET(#compname))
>     oServer:FIELDPUT(#compname, sComp)
>     oServer:Skip(1)
> enddo
> oServer:Close()
>
> Thanks for any advise to solve this issue.
>

[toc] | [prev] | [next] | [standalone]


#5836

FromRob van Erk <erk.v@hotmail.com>
Date2013-09-17 07:14 -0700
Message-ID<b303c5bf-5b12-43c0-90fc-cfeb39abfffa@googlegroups.com>
In reply to#5834
Hi Karl,

Thank you very much :-) This works perfectly well.

Brgds,
Rob

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web