# \`{File}.Record\` as PROCEDURE parameter, but how?

**URL:** <https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587>\
**Category:** questions\
**Tags:** c11\
**Created:** [September 10, 2025, 1:55pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587 "2025-09-10T13:55:16Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 1:55pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/1 "2025-09-10T13:55:16Z")

</div>

According to the help:  
 ![afbeelding](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/3/3ceb02282dc6cf1ffc8e914d9663e2df74a4db0e.png)  
See: [record\_declare\_record\_structure\_.htm [Clarion Community Help]](https://clarion.help/doku.php?id=record_declare_record_structure_.htm)  
One can pass a `RECORD` as parameter - but how? I tried `*{File}.Record` and `{File}.Record` but the IDE doesn’t save the change - so I guess it won’t allow me

In my case `{FILE}` is the label of the customers file - TOPSPEED

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 2:09pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/2 "2025-09-10T14:09:03Z")

</div>

If I do just `*{FILE}` I get `Label in prototype not defined`

---

<div class="post-metadata">

**Author:** ![greenslk](https://clarionhub.com/letter_avatar_proxy/v4/letter/g/7cd45c/32.png) [@greenslk](https://clarionhub.com/u/greenslk)\
**Post date:** [September 10, 2025, 2:32pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/3 "2025-09-10T14:32:48Z")

</div>

I’m just getting back into Clarion so going by memory here…

## In BEFORE Global Data, create a TYPE of the Record definition(s) you need

**typRec:Table** LIKE( **PRE:Record** ), **TYPE**

**PRE: is the prefix of the table/record you need**

## calling procedure

DATA  
myRec **typRec:Table**

CODE

SomeProc(myRec)

## called procedure

SomeProc PROCEDURE(\ ***typeRec:Table** pRec)  
CODE

! pRec:Field1  
! pRec:Field2  
…

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 2:39pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/4 "2025-09-10T14:39:41Z")

</div>

In `BEFORE Global Data` it throws `Field not found: RECORD` - if I move it to `Global Data` it does compile but it doesn’t have any fields, at least Intellisense doesn’t show fields - if i use a `GROUP` instead of `LIKE` intellisense does show fields, but during compilation it throws an error the field is not found, so:

```Clarion
typeRec:Table GROUP(FILE:Record),TYPE
END

```

Also using the `PRE` doesn’t compile - need to use the full file label

---

<div class="post-metadata">

**Author:** ![greenslk](https://clarionhub.com/letter_avatar_proxy/v4/letter/g/7cd45c/32.png) [@greenslk](https://clarionhub.com/u/greenslk)\
**Post date:** [September 10, 2025, 2:51pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/5 "2025-09-10T14:51:19Z")

</div>

ok…

## Lets say you have a file zEventLog PRE(zEVT) Record

END

## AFTER FILE DECLARATIONS

typRec:EventLog GROUP(),TYPE  
LIKE( **zEVT** :Record)  
END

## Local Data

myRec LIKE(typRec:EventLog)

CODE

!.. set myRec from record  
myRec = zEVT:Record

!.. call your proc  
TestProc(myRec)

---

<div class="post-metadata">

**Author:** ![RchdR](https://clarionhub.com/letter_avatar_proxy/v4/letter/r/d78d45/32.png) [@RchdR](https://clarionhub.com/u/RchdR)\
**Post date:** [September 10, 2025, 2:57pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/6 "2025-09-10T14:57:29Z")

</div>

(\*File pFilename) - Post must be 20 chars long min.

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 3:10pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/7 "2025-09-10T15:10:11Z")

</div>

Tried that, as mentioned getting an error that the label is not defined

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 3:10pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/8 "2025-09-10T15:10:28Z")

</div>

I’ll check tomorrow if that works

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [September 10, 2025, 4:31pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/9 "2025-09-10T16:31:56Z")

</div>

I’ve done (PRE:Record pRecord) before. But you have to make sure that the file is always generated so that the prototype can see it. The chicken has to be hatched before the egg is laid, or something like that.

---

<div class="post-metadata">

**Author:** ![RchdR](https://clarionhub.com/letter_avatar_proxy/v4/letter/r/d78d45/32.png) [@RchdR](https://clarionhub.com/u/RchdR)\
**Post date:** [September 10, 2025, 4:40pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/10 "2025-09-10T16:40:23Z")

</div>

in cpxml.clw/.inc its used here

```clarion
!=== FILE ========
FileToDOM PROCEDURE(*file f, <string root>,<string label>, DOMStyle style=DOMStyle:ADO_26, byte removePrefix = true,<MapQueue nameMap>)

```

but in abFile its defined simply as File and not \*File.

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 10, 2025, 4:49pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/11 "2025-09-10T16:49:30Z")

</div>

And how can I be sure of that? I can use the FILE inside the procedure without issues - it’s just the PROTOTYPE giving the error

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [September 10, 2025, 4:58pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/12 "2025-09-10T16:58:49Z")

</div>

don’t include { } inside of the prototype  
Please show us your actual code, so we can help you

Yes you can pass the record buffer as a group, or better yet as a typed group

I like to write:

```auto
gtRec_ADJ GROUP(ADJ:Record),TYPE,PRE(gtADJ); END

```

I use dot notation on the group - I don’t use it’s prefix  
But it’s required to add a prefix - to replace the original prefix in the file  
Keys need to have a prefix so nearly all files need to have a prefix

so with that data type I can write:

```auto
SomeProc PROCEDURE(*gtREC_ADJ xADJ)
  CODE
  xADJ.ID = 42 ! point being I have access to all of the fields in the file

```

I can call :

```auto
SomeProc( ADJ:Record )
SomeProc( Adjustment.Record )
SomeProc( Adjustment{PROP:Record} ) ! this might work, I haven't tested it

```

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [September 11, 2025, 7:15am UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/13 "2025-09-11T07:15:14Z")

</div>

This makes it compile, sort of - it seems all type information is lost, so it no longer shows the fields with autocomplete

EDIT: Error was due to a missing variable, oops

---

<div class="post-metadata">

**Author:** ![ThaDaSoft](https://clarionhub.com/user_avatar/clarionhub.com/thadasoft/32/3743_2.png) [@ThaDaSoft](https://clarionhub.com/u/ThaDaSoft)\
**Post date:** [October 28, 2026, 3:09pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/14 "2026-10-28T15:09:29Z")

</div>

Just needed to do this again, the example from @MarkGoldberg works, but only if used as PROCEDURE parameter I can access the fields (ex1)- the one from @greenslk using `LIKE` instead of `GROUP` also allows it to be used as local variable with access to the fields (ex2)

FILE:

```clarion
Dummy FILE,DRIVER('TOPSPEED'),NAME('data\Dummy.dat'),PRE(DUM),CREATE
Dum_KeyNr KEY(DUM:Nummer),PRIMARY,NOCASE,OPT
record RECORD
Nummer STRING(1)
                  END
                END

```

EX1:

```clarion
Record:Dummy GROUP(DUM:Record),TYPE,PRE(R:DUM)
END

PROC_WORKS PROCEDURE(*Record:Dummy dumdum)
    CODE
        dumdum.Nummer = 1;

PROC_NO_WORKS PROCEDURE()
!dumdum Record:Dummy ! Does not compile
dumdum LIKE(Record:Dummy)
!or
!dumdum GROUP(Record:Dummy),PRE(dd)
!END
    CODE
        dumdum.Nummer = 1; ! FIELD NOT FOUND

```

EX2:

```clarion
Record:Dummy LIKE(DUM:Record),TYPE

PROC_WORKS PROCEDURE()
!dumdum Record:Dummy ! Does not compile sadly
dumdum LIKE(Record:Dummy)
    CODE
        dumdum.Nummer = 1;

```

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [October 28, 2026, 4:06pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/16 "2026-10-28T16:06:29Z")

</div>

That's really weird - I was able to reproduce that unexpected behavior using 11.0.13244

FWIW, you could re-write PROC\_NO\_WORKS as

```clarion
PROC_NO_WORKS PROCEDURE()
dumdum GROUP(Dummy.Record),PRE(DD);END ! compiles
!dumdum GROUP(Dummy:Record),PRE(DD);END ! compiles
!dumdum GROUP(DUM:Record),PRE(DD);END ! compiles

!dumdum LIKE(Dummy.Record) ! compiles
!dumdum LIKE(Dummy:Record) ! compiles
!dumdum LIKE(DUM:Record) ! compiles
    CODE
        dumdum.Nummer = 1; ! FIELD NOT FOUND

```

The purpose of the `,TYPE` was to be able to pass a record as a parameter and have access to field(s). But if the **File** Dummy is in scope then the above LIKE compiles just fine

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [October 28, 2026, 4:15pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/17 "2026-10-28T16:15:46Z")

</div>

> [@ThaDaSoft](#):
>
> ```auto
> Record:Dummy GROUP(DUM:Record),TYPE,PRE(R:DUM)
> END
> 
> ```

Replacing the PREFIX with `PRE(RDUM)` allows it to compile  
my guess is the the `:` exposed the odd behavior

```clarion
Record:Dummy GROUP(DUM:Record),TYPE,PRE(RDUM)
END

```

---

<div class="post-metadata">

**Author:** ![also](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@also](https://clarionhub.com/u/also)\
**Post date:** [October 28, 2026, 5:39pm UTC](https://clarionhub.com/t/file-record-as-procedure-parameter-but-how/8587/18 "2026-10-28T17:39:29Z")

</div>

The support of parameters of \*GROUP type (both generic and having a named type) is very partial. The compiler produces different errors for parameters of such types and their usage. Fixes for known me issues related to parameters of GROUP types were sent to SV several months ago.
