pass group as parm (actually wanting to pass record)

This is a discussion on pass group as parm (actually wanting to pass record) within the Clarion forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > Clarion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-03-2008, 04:13 PM
Stanguru
Guest
 
Default pass group as parm (actually wanting to pass record)

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)
Reply With Quote
  #2  
Old 04-03-2008, 09:44 PM
pblais@odstrategies.org
Guest
 
Default Re: pass group as parm (actually wanting to pass record)

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
Reply With Quote
  #3  
Old 04-04-2008, 08:34 AM
Stanguru
Guest
 
Default Re: pass group as parm (actually wanting to pass record)

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
Reply With Quote
  #4  
Old 04-04-2008, 12:50 PM
Brad Kunkel
Guest
 
Default Re: pass group as parm (actually wanting to pass record)

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)



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:11 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.