Elements of a complex Typed Group Array cannot be parameter passed

So I’ve got a “complex” Group structure, and within it I have elements which match the procedure parameters, yet the compiler complains.

GDT:GUID             GROUP,TYPE,PRE(GDT)
Data1                  ULONG
Data2                  USHORT
Data3                  USHORT
Data4                  BYTE,DIM(8)
                     END
ISEQ:Device:Interface:Processor                 Equate('{{50127dc3-0f36-415e-a6cc-4cb3be910b65}')   ! Includes processor types.
GND:DBD:DIG          GROUP,PRE(),DIM(60)
DBD:DeviceInterfaceGuidString STRING(40)
DBD:Dev_Broadcast_DeviceInterface_Handle LONG
DBD:Dev_Broadcast_DeviceInterface_AGrp GROUP,PRE()
DBD:dbcc_size            ULONG
DBD:dbcc_devicetype      ULONG(ISEQ:Device:DBT_DEVTYP_DEVICEINTERFACE)
DBD:dbcc_reserved        ULONG
DBD:dbcc_classguidGrp    GROUP,PRE()
DBD:Data1                  ULONG
DBD:Data2                  USHORT
DBD:Data3                  USHORT
DBD:Data4                  BYTE,DIM(8)
                         END
DBD:dbcc_name            BYTE
                       END
                     END
GND:DBD:DIG[1].DBD:DeviceInterfaceGuidString = ISEQ:Device:Interface:Processor
GuidFromStringA( GND:DBD:DIG[1].DBD:DeviceInterfaceGuidString, GND:DBD:DIG[1].DBD:Dev_Broadcast_DeviceInterface_AGrp.DBD:dbcc_classguidGrp )
GuidFromStringA      PROCEDURE  ( String pGuidString, *GDT:Guid pGuid) 

For now I have some local vars defined, assign values to those and use them in the GuidFromStringA procedure parameters. It works.

But should the compiler complain?

What error does the compiler report? On what line of code?

Your code above does not show you calling the procedure, or instantiating a group to be passed.

1 Like

Syntax Error. No matching prototype available is the error message and then the line is the one calling GuidFromStringA.

But I’ve changed the Group structure now to speed up looking through the data.

GND:DBD:DeviceInterfaceGuidString STRING(40),DIM(60)
GND:DBD:Dev_Broadcast_DeviceInterface_Handle LONG,DIM(60)
GND:DBD:Dev_Broadcast_DeviceInterface_AGrp GROUP,PRE(),DIM(60)
DBD:dbcc_size          ULONG
DBD:dbcc_devicetype    ULONG(ISEQ:Device:DBT_DEVTYP_DEVICEINTERFACE)
DBD:dbcc_reserved      ULONG
DBD:dbcc_classguidGrp  GROUP,PRE()
DBD:Data1                ULONG
DBD:Data2                USHORT
DBD:Data3                USHORT
DBD:Data4                BYTE,DIM(8)
                       END
DBD:dbcc_name          BYTE
                     END
Loc:RVBool          = GuidFromStringA( GND:DBD:DeviceInterfaceGuidString[ Loc:Cnt ], GND:DBD:Dev_Broadcast_DeviceInterface_AGrp[Loc:Cnt].DBD:dbcc_classguidGrp )

This still throws the same compiler error.

ok, cool, I see the problem.
So you are prototyping the parameter as “receiving a group”.
GuidFromStringA PROCEDURE ( String pGuidString, *GDT:Guid pGuid)

But the variable is decalred as a Group Array

(I’m going to assume you’ve updated your group type to match - that’s the updating I assume you’re refering to.)

So, short version, you can’t pass an element of a group in as a *group. You can pass the whole group array, you can pass a non-arrayed group, but you can’t use the syntax as you have it.

At this point I’m a little confused as to what group is used, and passed, and prototyped - but I’m assuming you’ve got that in order. But you can’t pass somegroup[4] to a function prototyped as taking *somegroup.

Ok, I was hoping the data type parameter would just overlay starting from the memory address of the matching part of the bigger group and that part would be passed.

Anyway I have it working by assigning the GUID values from the bigger group into a local GUID group and pass that.