Mon Oct 18, 2021 7:38 am
Login Register Lost Password? Contact Us


Newbe - getting to grips with more compiler errors.

Comments and questions related to the Enterprise Control Language

Tue Oct 11, 2011 2:49 pm Change Time Zone

Hi Me Again.

Unable to get any of my own ECL to work I've fallen back on attempting to get 'Bible Search' example working from the WEB.

http://www.dabhand.org/ECL/construct_a_ ... search.htm

and

http://www.dabhand.org/ECL/construct_a_ ... archII.htm


I get the 1st part working, i.e. the defines for reading in, transforming and functions for future probes.
By working there are no syntax errors, and submitting it creates a successfully completed workunit.

I'm now stuck on the 2nd part. Creating something used to query the data.
The code 'Inversion.ecl' I've entered so far is:
Code: Select all
IMPORT * FROM STD.Str;

EXPORT Inversion := MODULE

  SHARED I := $.File_KJV.txt;
     
    SHARED R := RECORD
      UNSIGNED1 BookNum := 0;
        UNSIGNED1 Chapter := 0;
        UNSIGNED1 Verse   := 0;
        UNSIGNED1 Word_pos:= 0;
        STRING    Word    := '';
    END;

R TakeWord(I le,UNSIGNED1 C) := TRANSFORM
   SELF.Word_pos := C;
     SELF.Word := ToUpperCase(GetNthWord($.Clean(le.verse_text),C));
     SELF := le;
END:

N := NORMALIZE(I,WordCount($.Clean(LEFT.verse_Text)),TakeWord(LEFT,COUNTER));
EXPORT Records := N;

END;


I've also created a 'clean.ecl' with a single EXPORT in it.
Code: Select all
IMPORT * FROM STD.Str;

EXPORT Clean(STRING S) := Filter(S,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 \'');


However the syntax check on the 'Inversion.ecl' reports:
Code: Select all
Error:    Unknown identifier "N" (21, 1), 2167,
Error:    Incompatible types: can not assign Integer to Record r (15, 11), 2007,
Error:    Unknown identifier "N" (22, 19), 2167,


Any pointers would be gratefully received as the error message is not enlightening.

Yours

Allan
Allan
 
Posts: 439
Joined: Sat Oct 01, 2011 7:26 pm

Tue Oct 11, 2011 3:01 pm Change Time Zone

All,

Found my own error!

Code: Select all
R TakeWord(I le,UNSIGNED1 C) := TRANSFORM
   SELF.Word_pos := C;
    SELF.Word := ToUpperCase(GetNthWord($.Clean(le.verse_text),C));
    SELF := le;
END:

Should be:
Code: Select all
R TakeWord(I le,UNSIGNED1 C) := TRANSFORM
   SELF.Word_pos := C;
    SELF.Word := ToUpperCase(GetNthWord($.Clean(le.verse_text),C));
    SELF := le;
END;


Spot the difference in the terminating ';' - I suppose the STL in C++ generates as obscure error messages (but only just)
Allan
 
Posts: 439
Joined: Sat Oct 01, 2011 7:26 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron