common code patterns

Malte Pfaff-Brill revolution at derbrill.de
Thu Aug 10 16:18:20 EDT 2017


Hi Monte,

What I do way too often is combining all parameters of a function in a string and then split them up again as needed e.g.:


repeat with i=1 to paramcount()
	if i<paramcount() then
        	put param(i)&"," after theValue
         else
            put param(i) after theValue
         end if
end repeat

— specific code follows:

 put item 1 of theValue into isLeft
 put item 2 of theValue into isTop
 put item 3 of theValue into isRight
 put item 4 of theValue into isBottom


As this allows me to pass most variants to the function:

myFunction(10,20,30,40)

Or

myFunction(the rect of grc „myGraphic"
myFunction(the loc of me,10,






More information about the Use-livecode mailing list