1. What the heck does this mean?

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?

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?

On Thu, 29 Jan 2004 21:56:50 +0000, Jonas  Temple <jtemple at yhti.net>
wrote:

>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)
				^^^^^^

You've overridden the builtin length() function. I assume you are
running "without warning" otherwise Euphoria would give you a warning
about this when the program ends.

Regards,
Pete

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

4. Re: What the heck does this mean?

On Thu, 29 Jan 2004 23:58:35 +0000, Ron Austin <ronaustin at alltel.net>
wrote:

>I think at least one word, LENGTH is missing from this list.  There may 
>be more words missing.
I think the list is technically complete. Somewhere in the docs Rob
explains a technique for overwriting a builtin function and calling
the original, I believe something like this:

function original_length_function(sequence x)
	return length(x)
end function

function length(object x)
	if not sequence(x) then return 0 end if
	return original_length_function(x)
end function

Regards,
Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu