Module cannot be exported
Hi,
I have problem running the following code (it's from Introduction to ECL 2 Course):
IMPORT $,STD;
EXPORT STD_Persons := MODULE
EXPORT Layout := RECORD
$.UID_Persons.UID;
$.UID_Persons.RecID;
STRING15 FirstName := STD.Str.ToUpperCase($.UID_Persons.FirstName);
STRING25 LastName := STD.Str.ToUpperCase($.UID_Persons.LastName);
STRING1 MiddleName := STD.Str.ToUpperCase($.UID_Persons.MiddleName);
STRING2 NameSuffix := STD.Str.ToUpperCase($.UID_Persons.NameSuffix);
UNSIGNED4 FileDate := (UNSIGNED4)$.UID_Persons.FileDate;
$.UID_Persons.BureauCode;
$.UID_Persons.Gender;
$.UID_Persons.DependentCount;
UNSIGNED4 BirthDate := (UNSIGNED4)$.UID_Persons.BirthDate;
$.UID_Persons.StreetAddress;
$.UID_Persons.City;
$.UID_Persons.State;
UNSIGNED3 ZipCode := (UNSIGNED3)$.UID_Persons.ZipCode;
END;
EXPORT File :=output($.UID_Persons,Layout)
ERSIST('~CLASS::SS::PERSIST::STD_Persons');
END;
I get error C2386: Module OnlineShayan.STD_Persons does not EXPORT an attribute main() (0, 0), 0,
The code works well if I perform it as an action. But as a module, I can't export it. What do you think is the problem?
Thanks,
Shayan
I have problem running the following code (it's from Introduction to ECL 2 Course):
IMPORT $,STD;
EXPORT STD_Persons := MODULE
EXPORT Layout := RECORD
$.UID_Persons.UID;
$.UID_Persons.RecID;
STRING15 FirstName := STD.Str.ToUpperCase($.UID_Persons.FirstName);
STRING25 LastName := STD.Str.ToUpperCase($.UID_Persons.LastName);
STRING1 MiddleName := STD.Str.ToUpperCase($.UID_Persons.MiddleName);
STRING2 NameSuffix := STD.Str.ToUpperCase($.UID_Persons.NameSuffix);
UNSIGNED4 FileDate := (UNSIGNED4)$.UID_Persons.FileDate;
$.UID_Persons.BureauCode;
$.UID_Persons.Gender;
$.UID_Persons.DependentCount;
UNSIGNED4 BirthDate := (UNSIGNED4)$.UID_Persons.BirthDate;
$.UID_Persons.StreetAddress;
$.UID_Persons.City;
$.UID_Persons.State;
UNSIGNED3 ZipCode := (UNSIGNED3)$.UID_Persons.ZipCode;
END;
EXPORT File :=output($.UID_Persons,Layout)

END;
I get error C2386: Module OnlineShayan.STD_Persons does not EXPORT an attribute main() (0, 0), 0,
The code works well if I perform it as an action. But as a module, I can't export it. What do you think is the problem?
Thanks,
Shayan
- sh.shmss
- Posts: 4
- Joined: Fri Aug 24, 2018 3:24 pm
Shayan,
I presume when you said:
So, the real lesson here is: never just hit "Submit" on a definition file (any file that contains an EXPORT or SHARED definition) -- because sometimes it will work and sometimes it won't (and in this case, it won't). If you want to run your code, the file you "Submit" should always be "BWR" code ("Builder Window Runnable" code as discussed in the ECL courses).
HTH,
Richard
I presume when you said:
That what you meant was you could not just hit "Submit" and run a workunit. And the reason for that is implied by the error message:The code works well if I perform it as an action. But as a module, I can't export it.
- Code: Select all
Module OnlineShayan.STD_Persons does not EXPORT an attribute main() (0, 0), 0,
So, the real lesson here is: never just hit "Submit" on a definition file (any file that contains an EXPORT or SHARED definition) -- because sometimes it will work and sometimes it won't (and in this case, it won't). If you want to run your code, the file you "Submit" should always be "BWR" code ("Builder Window Runnable" code as discussed in the ECL courses).
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest