| |
|
|
| proc name( [ Parameter, [ ...
Definiert a procedure/ namens name and your (optionalen) Parameter The names the variables.
Procedures can values all Variablentypen (including Arrays) by return zurückliefern.
Procedures can About- and Unterladen go: Parameter must not on a Proc transfer go, too then not, if which definiert are. Übergibt one on a Proc z.B. only The Parameter a and b instead of too c, then is c in Proc definiert but has the value zero. so can too within of/ one Proc discern, whether a Parameter transfer watts or not. an Proc without Return supply always zero. Info: zero isn't same 0!
In Infinity-Profan there too Procs in Procs, The internal Procs only in the Elternproc famous.
How with XProfan and XPSE with nProcs is it in Infinity-Profan alike, whether Procs on the Programmkopf or foot definiert go, there the Kompilierer ohnehin whom View source umsortiert and the objectively verwendeten functions on the suitable place the Quelltextes verknüpft. so can itself supra in the Programmkopf on the actual View source/ term concentrate and benötigte Procs on the foot take off.
The constraint the Number of übergebenen Parameter lying theoretical with 9100, however should so many Parameter none Proc transfer to be Speicherprobleme To avoid.
Parameterwerte go byValue transfer, byRef for Arrays with vorangestelltem @ before each Parameternamen. On Parameter, The not of type aray transfer go, has @ none Einfluss, however becomes The check for this Parameter on a aray-copy at settle the @-Zeichens shorted. with functions, with them it on supreme speed ankommt, is means a optimization by @ for each Parameter with einzubeziehen.
Info: Zeiger on a Proc by @Procname
Examples:
likewise - dank Space-Operator - einfachere Syntax possible:
with the Parameter-Definition can also same one Vorwert transfer go, one worth the used go should if the Parameter not transfer watts:
same:
the goes too:
same:
Info to performance:
is faster as:
because for all Parameter The check on one aray wegfällt, which data ggf. for Proc dupliziert would.
Keywords: Procedures, functionsproc endproc |
|
|
| |
|
|
|
HofK | How is the manner the Parameter Passing vorgesehen?
only call by value? but with arrays? |
|
|
| |
|
|
|
| with Arrays and Procs The reference, otherwise the worth. |
|
|
| |
|
|
|
HofK | OK, can with want too einelementiges aray a transfer, then but a[0] always "mitschleppen".
what speaks (intern?) against proc example(var a, var b, c, d) to Übergabe "by reference"? |
|
|
| |
|
|
|
| have there a idea:
If you on a variable byref grab want, then deklariere tappt im dunkeln still simply not in the Parameter-Description.
the var in the Parameterbeschreibung could redundant understood and be is imho not eineindeutig, then sooner byref a, byref b, or C-Style &a, &b...
the can I naturally install, but I stops it for Doppelgemoppel because of "Idee". |
|
|
| |
|
|
|
HofK | for a particular betrachtetes Program take so did i globale variables in the procedure.
If I me but Procedures as Own "Features" to manipulation too of variables write, The I in different Programs bring into action would like, there a problem with the Bezeichnern. once is The Variable about meineSpezialzeit, in another Program because of the internal Systematik but x_time. then should one The global variables in the procedure extra rename.
one ought to the in the procedure used global variables too extra somehow document, otherwise übersieht one slight something. as Parameter with z.B. proc bsp(ref a, ref b, c, d) are you against it explicit visible. (with GFA was is then "doppelt" var)
in the Context must one but sure too The Namensräume with Include (see XProfan) viewing. is everything sooner no Anfängerproblematik, More take off AndroidProfanXtended. |
|
|
| |
|
|
|
| Yes the understand I, will be such Syntax then for later versions umsetzen. I find the "ref" not so bad, so go we the well . Make |
|
|
| |
|
|
|
| likewise - dank Space-Operator - einfachere Syntax possible:
|
|
|
| |
|
|
|
| with the Parameter-Definition can also same one Vorwert transfer go, one worth the used go should if the Parameter not transfer watts:
same:
the goes too:
same:
|
|
|
| |
|
|
|
| Proc-Parameter type aray Übergabe now byVal instead of byRef: [...] |
|
|
| |
|
|