English
Functions and Help

Sprachelement: proc

 
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:
proc meineProc(a,b,c)

    /// ...
    /// return

endproc


likewise - dank Space-Operator - einfachere Syntax possible:
proc meineProc a b c

    /// ...
    /// return

endproc


with the Parameter-Definition can also same one Vorwert transfer go, one worth the used go should if the Parameter not transfer watts:
proc Test(a,b,c=50)

    return c

endproc

print Test()// gives 50 from

same:
proc Test a b c=50

    return c

endproc

print Test()// gives 50 from

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, functions

proc
endproc
 
02/14/15  
 




HofK
How is the manner the Parameter Passing vorgesehen?

only call by value? but with arrays?
 
03/10/15  
 



with Arrays and Procs The reference, otherwise the worth.
 
03/11/15  
 




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"?
 
03/12/15  
 



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".
 
03/12/15  
 




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.
 
03/12/15  
 



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
 
03/13/15  
 



likewise - dank Space-Operator - einfachere Syntax possible:
proc meineProc a b c

    /// ...
    /// return

endproc

 
05/24/15  
 



with the Parameter-Definition can also same one Vorwert transfer go, one worth the used go should if the Parameter not transfer watts:
proc Test(a,b,c=50)

    return c

endproc

print Test()// gives 50 from

same:
proc Test a b c=50

    return c

endproc

print Test()// gives 50 from

the goes too:

same:
 
05/24/15  
 



Proc-Parameter type aray Übergabe now byVal instead of byRef:  [...] 
 
01/11/16  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

12.076 Views

Untitledvor 0 min.
Sven Bader08/04/21
Micha1233405/18/16
Michael W.04/09/16
HofK04/08/16
More...

Themeninformationen

this Topic has 2 subscriber:

iF (7x)
HofK (3x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie