| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| trying to make a CSV string out of a record yeah i know there are templates and such, but i need to do it myself going cross-eyed searching and using help, and have tried every which way i dont t-totally understand how to references map builddetailrecord procedure(*group),string end Wrktxt FILE,DRIVER('ASCII'),PRE(Wtxt),CREATE,BINDABLE,THR EAD Record record BigField string(2000) end END ..... Set(wrkfile) Loop Next(wrkfile) If Errorcode() Then Break. stop(wrkc:record) wtxt:bigfield = BuildDetailRecord(wrkc:record) ADD(Wrktxt) end !end loop .... BuildDetailRecord procedure(*group inrec) Outstring cstring(2000) InRecord &inrec code clear(Outstring) stop('here in BDR - ' & InRecord{prop:fields}) Loop i# = 1 To InRecord{prop:fields} case InRecord{PROP:Type, i#} of 'STRING' OutString = Clip(OutString) & '"' & clip(What(InRecord, i#)) & '",' of 'DATE' OutString = Clip(OutString) & '"' & clip(format(What(InRecord, i#),@d017)) & '",' Else OutString = Clip(OutString) & clip(What(Inrecord, i#)) & ',' End End return(OutString) |
|
#2
| |||
| |||
| You can't pass a group by reference but you can pass a group TYPE by reference. You can pass a group as a string. It appears you understand the problem. On Thu, 3 Apr 2008 13:13:21 -0700 (PDT), Stanguru <stanguru@gmail.com> wrote: >i dont t-totally understand how to references > > map >builddetailrecord procedure(*group),string > end --------------------------------------- Paul Blais - Hayes, Virginia |
|
#3
| |||
| |||
| On Apr 3, 9:44 pm, pbl...@odstrategies.org wrote: > You can't pass a group by reference but you can pass a group TYPE by > reference. You can pass a group as a string. It appears you understand > the problem. > > On Thu, 3 Apr 2008 13:13:21 -0700 (PDT), Stanguru <stang...@gmail.com> > wrote: > > >i dont t-totally understand how to references > > > map > >builddetailrecord procedure(*group),string > > end > > --------------------------------------- > Paul Blais - Hayes, Virginia i kinda understand it, but i figure out how to get it back out of wherever inside the actual procedure |
|
#4
| |||
| |||
| I believe the following will work as long as the file Wrktxt is defined in the dictionary or globally. In the parent procedure: map builddetailrecord procedure(*Wtxt:Record),string end passRec GROUP(Wtxt:Record) rtnString STRING(1000) CODE passRec = Wtxt:Record rtnString = builddetailrecord(passRec) ... HTH, Brad Kunkel Integrated Business, Inc. "Stanguru" <stanguru@gmail.com> wrote in message news:8e1b6955-8826-4c1d-a8db-1363b54d70ac@d45g2000hsc.googlegroups.com... > trying to make a CSV string out of a record > yeah i know there are templates and such, but i need to do it myself > going cross-eyed searching and using help, and have tried every which > way > i dont t-totally understand how to references > > map > builddetailrecord procedure(*group),string > end > > Wrktxt > FILE,DRIVER('ASCII'),PRE(Wtxt),CREATE,BINDABLE,THR EAD > Record record > BigField string(2000) > end > END > > > .... > Set(wrkfile) > Loop > Next(wrkfile) > If Errorcode() Then Break. > stop(wrkc:record) > wtxt:bigfield = BuildDetailRecord(wrkc:record) > ADD(Wrktxt) > end !end loop > > ... > BuildDetailRecord procedure(*group inrec) > > Outstring cstring(2000) > InRecord &inrec > > > code > clear(Outstring) > stop('here in BDR - ' & InRecord{prop:fields}) > Loop i# = 1 To InRecord{prop:fields} > case InRecord{PROP:Type, i#} > of 'STRING' > OutString = Clip(OutString) & '"' & clip(What(InRecord, i#)) > & '",' > of 'DATE' > OutString = Clip(OutString) & '"' & > clip(format(What(InRecord, i#),@d017)) & '",' > Else > OutString = Clip(OutString) & clip(What(Inrecord, i#)) & ',' > End > End > return(OutString) |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.