ProtoType change in one app is not reflected in another referenced app

Hi All,

I have a question regarding the Procedure prototype change in Clarion10.

For example I am having 2 Application named A.app and B.app

A.app contains procedure with name AProc() and prototype as AProc(), byte and it is marked as External.
Now B.app has a reference to A.app and it is using AProc() of A.app.

Now if i change the prototype of AProc() as AProc(), string (Have changed the return type from byte to string). Compile the Project (A.app).

Now when i go to B.app which is referencing A.app >> AProc() , the prototype is not changed in B.app.

I keep on deleting it manually. Is there any way when we compile the A.app, The referenced projects also gets synched?

Hi,

If you change the prototype of a procedure in an app, then all other places that call that procedure (in other apps), must contain the same prototype.

For example:-

In library.app, where the proc is exported from -

Calc_Salutation(STRING pFirstname, STRING pLastname, < STRING pTitle>),STRING

In main.app, where the proc is defined as external -

Calc_Salutation(STRING pFirstname, STRING pLastname, < STRING pTitle>),STRING

I hope that helps,

Regards,

Andy
noyantis.com

If the below proc from library.app changes in future, lets say changing the return type to byte:

Calc_Salutation(STRING pFirstname, STRING pLastname, < STRING pTitle>),Byte

So the main.app where this proc is defined as external, where it was returning String

Calc_Salutation(STRING pFirstname, STRING pLastname, < STRING pTitle>),STRING

So once we build and compile the library.app, Will the change reflect to the main.app also i.e. auto change the return type to BYTE?

You will have to manually change the prototype in the main app too - after you have changed and compiled the library.app - that way, the .lib of the library app will reflect the new prototype and this will be used when you attempt to compile the main.app

Thanks,

Andy
noyantis.com

Yup that’s what i am doing i.e. manually changing the prototype.

As you get more APP’s it does become a pain the have to go change multiple other APPs that import the functions and specify a prototype in the External Procedure.

You can create an .INC file with all the Prototypes exported by the A.APP. So you have the Prototype in 2 places: the A APP Procedure, and the A.INC file.

Then in the B.APP in the A Module Properties there is a spot to specify the .INC file. That A.INC gets added to the B MAP. AppGen then ignores all the A function Prototypes you specified in the Externals. You do not even need to add the Externals … Edit: unless the Procedures are referenced by a Template or you want it in the Calls list.

image

This just saves fixing prototypes. You still will need to go fixup code that calls the changed function to use the different signature.

Don’t you need to add it as an external procedure if you want to use the procedure in a template prompt? Like in Menu actions or browse update procedure, etc.

1 Like

YES … you do need to add App / Template referenced Procedures to the App as External Procedures. Also if you want to see it in the Call Tree, that you added it to the procedure Calls list. I’ll edit my post.

The saving is there can be a bunch of little functions you don’t need to add, e.g. GetMonthName(LONG inDate),STRING.

Yep, that’s my understanding. I thought maybe you had a super-secret workaround. :slight_smile:

As I’m sure you know … If you didn’t define the External you would have a TODO Procedure.

The templates would generate a TODO Stub with just a Message(). Chances are good that would cause a duplicate symbol error because it has the same Name as the external.

The TODO’s are marked for EXPORT so if it did Compile the EXE probably would not Run as 2 DLLs would Export the same Symbol.

1 Like

Thanks Carl for the inputs, but i am having separate module for each procedure, Not sure where do i mention the .inc file. Do we have any parent module where i can specify the .inc file at application level?

In the Importing APP you have the “External DLL” Module properties that is Application Level. Pick “Module” in Tree View drop list to see the Modules.

So the below would be in the B App that has the External A Module. Add the INC file there.

image

1 Like