Type - Start Again

new topic     » topic index » view thread      » older message » newer message

Hello,

Playing with Peter Robinson's suggestion I realized that 
many of my existing codes could have been simplified by
his example. 

type customer(sequence x)
	integer x[1] as id
	sequence x[2] as name
	sequence x[3] as address
end type


Type definitions could replace the currently needed
constant id=1
constant name=2
constant address=3
type customer(sequence x)
	if length(x)=3
	and integer(x[id])
	and sequence(x[name])
	and sequence(x[address])
	then
		return 1
	else
		return 0
	end if
end type


(Although he suggested using "." instead of "as".)

Most of the answers replied to his general comment
but I would like to hear your opinion on the 
simplification shown above. What do you think?

Kind regards,

Salix

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu