Naming parameters in script >> Project Management >> Forum
Forum

Forum



SearchSearch   Users   Registration   Entrance
Today: 12.07.2025 - 00:35:53
Pages:  1  

Naming parameters in script

Advertising

/
MessageAuthor

Avisynth accepts in script calling functions with named parameters also without naming them as long as they are in correct order. This however creates problem when arrays are used. Incidentally arrays can not be named. In the following: functionname(width = 720, height = 480, x= 90, y = 100) can also be called as functionname(720,480,90,100) if the order of parameter named correspond to that actually used in the function code. incase of "fname", "ci*[width]i[height]i[x]i[y]i) if script call is fname(1,2,3,4,720,480,x=90,y=100) it is not clear whether 720 and 480 are taken in to i+ array or assigned to width and height as was intended. This scheme is error prone. I suggest that in 2.6 it may be made compulsory to make the names of named arguments be given in script. Should it not be possible to name even array parameters such as [table]i+ ? Vapoursynth does that and appears to be good.

---------------------------
ACS

KaOTiKM3

users




Statistics:
Messages: 89
Registration: 05.15.2002
25.06.23 - 02:28:59
Message # 1
RE: Naming parameters in script

in the instance the parameter list is c.*[ll]b[ss]s[ii]i all parameters can be read as part of the .* Possibly if the param list is c.*bsi one can get correctly. In such cases if the parameters are named for convenience, the plugin writer checking for Defined() and ensuring it is, may be way out.

---------------------------
F'Sho-

MaaadNYCe

users




Statistics:
Messages: 325
Registration: 11.13.2001
25.06.23 - 02:36:04
Message # 2
RE: Naming parameters in script

There is some advantage to putting array of type early in list of args, and forcing user to use the 'optional' argument name (for args following array, name no longer optional), it allows you to extend number of function arguments without breaking existing scripts.

---------------------------

WEB150

users




Statistics:
Messages: 665
Registration: 06.27.2003
25.06.23 - 02:42:54
Message # 3
RE: Naming parameters in script
PTLE 7 authorization code : Previous topic
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants