1. RE: Number of parameters

> From: Juergen Luethje [mailto:j.lue at gmx.de]

> in 'refman.doc' (2.4) it reads:
> "There are a fixed number of named parameters [for routines], but this
> is not restrictive since any parameter could be a variable-length
> sequence of arbitrary objects."
> 
> I had been thinking of 9 as the maximum number of parameters, but when
> I recently looked at the docs again, I realised that this only applies
> to call-back routines.
> What is the maximum number of parameters, that a normal 
> routine can take?

The limit appears to be 255.  Try this code:


include get.e

procedure make_file( atom params )
	integer fn, line
	
	fn = open("params.exw","w")
	
	puts(fn,"without warning\nprocedure test(")
	line = 0
	for i = 1 to params do
		printf(fn," atom a%d",i)
		line += 1
		if i != params then
			puts(fn,",")
			if line = 5 then
				puts(fn,"\n")
				line = 0
			end if
		end if
		
	end for
	printf(fn,")\n\t--? %d\nend
procedure\ncall_proc(routine_id(\"test\"),repeat(0,%d))\n",{params,params})

	close(fn)
end procedure

atom params, done
params = 0
done = 0
while not done do
	params += 1
	make_file( params )
	done = system_exec( "exw params.exw",0)
end while

printf(1,"Failed with %d parameters\n\nDone\n",params)
if wait_key() then end if

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu