1. RE: What the heck does this mean?

Looks to me like a conflict between function parameter 'length' and 
Euphoria base function 'length()'.

-- Brian
 
Jonas Temple wrote:
> 
> 
> Okay, I'm stumped.  I've got the following routine:
> 
> global function ecarc_rtvDataArea(sequence system_name, sequence 
> data_area_lib,
> 					sequence data_area, atom starting_pos,
> 					atom length, sequence dtaara_def)
> 
> 	sequence parm_str
> 	atom parm_length
> 
> 	parm_length = length(dtaara_def)
> 	-- We'll need to form the BEGSTR sequence using the parameter structure
> 	-- supplied to this routine
> 	parm_str = ecarc_makeStructure(QWCRDTAA_RtnVar & dtaara_def, 
> "DTAARA_RcvVar")
> 	parm_str &= QWCRDTAA
> 	-- Call the retrieve data area API
> 	parm_str = ecarc_call(system_name, "*LIBL", "QWCRDTAA", parm_str)
> 	-- If the parms returned is a sequence, return the 8th parm for the 
> length
> 	-- of the passed parm structure
> 	if sequence(parm_str) then
> 		return parm_str[8..(8 + parm_length - 1)]
> 	else
> 		return ""
> 	end if
> 
> end function
> 
> That when included in a program (a rather large proram), generates the 
> following error:
> 
> C:\Program Files\F.R.O.G. for IBM iSeries DB2\eucarc.ew:1025
> Syntax error - expected to see possibly 'end', not '('
>         parm_length = length(dtaara_def)
>                             ^
> If I comment the line out it runs fine.  
> 
> HELP!!!!!!!!!!!!!!!1
> 
> 
> Jonas
>

new topic     » topic index » view message » categorize

2. RE: What the heck does this mean?

Well, apparently you *can* as long as you're not using the function 
length() in your routine.

But just replace "atom length" with "atom len" or something...

euphoric wrote:
> 
> 
> Brian Broker wrote:
> 
> >
> >Looks to me like a conflict between function parameter 'length' and 
> >Euphoria base function 'length()'.
> >
> >-- Brian
> > 
> >Jonas Temple wrote:
> >  
> >
> >>Okay, I'm stumped.  I've got the following routine:
> >>
> >>global function ecarc_rtvDataArea(sequence system_name, sequence 
> >>data_area_lib,
> >>					sequence data_area, atom starting_pos,
> >>					atom length, sequence dtaara_def)
> >>    
> >>
> You can't have an "atom" named "length," right?
> 
>

new topic     » goto parent     » topic index » view message » categorize

3. RE: What the heck does this mean?

"atom length", thats the problem, It thinks you are using the atom, not 
the function.
Jonas Temple wrote:
> 
> 
> Okay, I'm stumped.  I've got the following routine:
> 
> global function ecarc_rtvDataArea(sequence system_name, sequence 
> data_area_lib,
> 					sequence data_area, atom starting_pos,
> 					atom length, sequence dtaara_def)
> 
> 	sequence parm_str
> 	atom parm_length
> 
> 	parm_length = length(dtaara_def)
> 	-- We'll need to form the BEGSTR sequence using the parameter structure
> 	-- supplied to this routine
> 	parm_str = ecarc_makeStructure(QWCRDTAA_RtnVar & dtaara_def, 
> "DTAARA_RcvVar")
> 	parm_str &= QWCRDTAA
> 	-- Call the retrieve data area API
> 	parm_str = ecarc_call(system_name, "*LIBL", "QWCRDTAA", parm_str)
> 	-- If the parms returned is a sequence, return the 8th parm for the 
> length
> 	-- of the passed parm structure
> 	if sequence(parm_str) then
> 		return parm_str[8..(8 + parm_length - 1)]
> 	else
> 		return ""
> 	end if
> 
> end function
> 
> That when included in a program (a rather large proram), generates the 
> following error:
> 
> C:\Program Files\F.R.O.G. for IBM iSeries DB2\eucarc.ew:1025
> Syntax error - expected to see possibly 'end', not '('
>         parm_length = length(dtaara_def)
>                             ^
> If I comment the line out it runs fine.  
> 
> HELP!!!!!!!!!!!!!!!1
> 
> 
> Jonas
>

new topic     » goto parent     » topic index » view message » categorize

4. RE: What the heck does this mean?

Jonas Temple wrote:
> 
> 
> Okay, I'm stumped.  I've got the following routine:
> 
> global function ecarc_rtvDataArea(sequence system_name, sequence 
> data_area_lib,
> 					sequence data_area, atom starting_pos,
> 					atom length, sequence dtaara_def)
> 
> 	sequence parm_str
> 	atom parm_length
> 
> 	parm_length = length(dtaara_def)
> 	-- We'll need to form the BEGSTR sequence using the parameter structure
> 	-- supplied to this routine
> 	parm_str = ecarc_makeStructure(QWCRDTAA_RtnVar & dtaara_def, 
> "DTAARA_RcvVar")
> 	parm_str &= QWCRDTAA
> 	-- Call the retrieve data area API
> 	parm_str = ecarc_call(system_name, "*LIBL", "QWCRDTAA", parm_str)
> 	-- If the parms returned is a sequence, return the 8th parm for the 
> length
> 	-- of the passed parm structure
> 	if sequence(parm_str) then
> 		return parm_str[8..(8 + parm_length - 1)]
> 	else
> 		return ""
> 	end if
> 
> end function
> 
> That when included in a program (a rather large proram), generates the 
> following error:
> 
> C:\Program Files\F.R.O.G. for IBM iSeries DB2\eucarc.ew:1025
> Syntax error - expected to see possibly 'end', not '('
>         parm_length = length(dtaara_def)
>                             ^
> If I comment the line out it runs fine.  
> 
> HELP!!!!!!!!!!!!!!!1
> 
> 
> Jonas
> 


jonas
i believe it has to do with your lengthy argument list.
somehow the interpreter is breaking it in half and expecting a matching 
parenthesis. maybe even caused by editor? (invisible character)
try to put arguments into 2 different ones, 1 seq of sequences and 1 
sequence of atoms.
also add extra characters to names if you want to use language keywords 
-- length to become vlength

later
rudy
lotterywars

new topic     » goto parent     » topic index » view message » categorize

5. RE: What the heck does this mean?

rudy toews wrote:
> 
> 
> Jonas Temple wrote:
> > 
> > 
> > Okay, I'm stumped.  I've got the following routine:
> > 
> > global function ecarc_rtvDataArea(sequence system_name, sequence 
> > data_area_lib,
> > 					sequence data_area, atom starting_pos,
> > 					atom length, sequence dtaara_def)
> > 
> > 	sequence parm_str
> > 	atom parm_length
> > 
> > 	parm_length = length(dtaara_def)
> > 	-- We'll need to form the BEGSTR sequence using the parameter structure
> > 	-- supplied to this routine
> > 	parm_str = ecarc_makeStructure(QWCRDTAA_RtnVar & dtaara_def, 
> > "DTAARA_RcvVar")
> > 	parm_str &= QWCRDTAA
> > 	-- Call the retrieve data area API
> > 	parm_str = ecarc_call(system_name, "*LIBL", "QWCRDTAA", parm_str)
> > 	-- If the parms returned is a sequence, return the 8th parm for the 
> > length
> > 	-- of the passed parm structure
> > 	if sequence(parm_str) then
> > 		return parm_str[8..(8 + parm_length - 1)]
> > 	else
> > 		return ""
> > 	end if
> > 
> > end function
> > 
> > That when included in a program (a rather large proram), generates the 
> > following error:
> > 
> > C:\Program Files\F.R.O.G. for IBM iSeries DB2\eucarc.ew:1025
> > Syntax error - expected to see possibly 'end', not '('
> >         parm_length = length(dtaara_def)
> >                             ^
> > If I comment the line out it runs fine.  
> > 
> > HELP!!!!!!!!!!!!!!!1
> > 
> > 
> > Jonas
> > 
> 
> jonas
> i believe it has to do with your lengthy argument list.
> somehow the interpreter is breaking it in half and expecting a matching 
> parenthesis. maybe even caused by editor? (invisible character)
> try to put arguments into 2 different ones, 1 seq of sequences and 1 
> sequence of atoms.
> also add extra characters to names if you want to use language keywords 
> -- length to become vlength
> 
> later
> rudy
> lotterywars
> 
I think the error has been pointed out, but I'll add my two cents worth. 
 The Euphoria manual has this:

2.4.1 Identifiers 

Identifiers, which consist of variable names and other user-defined 
symbols, may be of any length. Upper and lower case are distinct. 
Identifiers must start with a letter and then be followed by letters, 
digits or underscores. The following reserved words have special meaning 
in Euphoria and may not be used as identifiers: 

    and            end             include          to
    by             exit            not              type
    constant       for             or               while
    do             function        procedure        with
    else           global          return           without
    elsif          if              then             xor

I think at least one word, LENGTH is missing from this list.  There may 
be more words missing.

new topic     » goto parent     » topic index » view message » categorize

6. RE: What the heck does this mean?

> -----Original Message-----
>
> Jonas Temple wrote:
> >
> >
> > Okay, I'm stumped.  I've got the following routine:
> >
> > global function ecarc_rtvDataArea(sequence system_name, sequence
> > data_area_lib,
> > 					sequence data_area,
> atom starting_pos,
> > 					atom length, sequence
> dtaara_def)
> >
> > 	sequence parm_str
> > 	atom parm_length
> >
> > 	parm_length = length(dtaara_def)
> > 	-- We'll need to form the BEGSTR sequence using the
> parameter structure
> > 	-- supplied to this routine
> > 	parm_str = ecarc_makeStructure(QWCRDTAA_RtnVar & dtaara_def,
> > "DTAARA_RcvVar")
> > 	parm_str &= QWCRDTAA
> > 	-- Call the retrieve data area API
> > 	parm_str = ecarc_call(system_name, "*LIBL", "QWCRDTAA",
> parm_str)
> > 	-- If the parms returned is a sequence, return the 8th
> parm for the
> > length
> > 	-- of the passed parm structure
> > 	if sequence(parm_str) then
> > 		return parm_str[8..(8 + parm_length - 1)]
> > 	else
> > 		return ""
> > 	end if
> >
> > end function
> >
> > That when included in a program (a rather large proram),
> generates the
> > following error:
> >
> > C:\Program Files\F.R.O.G. for IBM iSeries DB2\eucarc.ew:1025
> > Syntax error - expected to see possibly 'end', not '('
> >         parm_length = length(dtaara_def)
> >                             ^
> > If I comment the line out it runs fine.
> >
> > HELP!!!!!!!!!!!!!!!1
> >
> >
> > Jonas
> >
>

The problem is that one of the parameters is called 'length' and when you
use "parm_length = length(dtaara_def)" Eu thinks that you are referring to
the parameter and not the built-in function.

Renaming this parameter fixes the problem.

--
Derek

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu