English
Source / code snippets

Polymorphe procedure

 

HofK
particularly efficient are oftmals polymorphe Procedures.
the functions with Infinity-Profan integrally simply.

yesterday on the 24.02. wrote I yet:
_________________________________________________________
If then sometime another Sonderzeichen for var( ) How °a remain ought to would it superzumquadrat!
_________________________________________________________

and today already could I var(a) through °a supplant!

// polymorphe procedure

print poly 8 3
print poly "only these Zeichenkette watts transfer!"
print poly "Text with number" 7
print poly "Text with number" 2.71
print poly "Text-number-Wahrheitswert " 1998 true
print poly 2 4 2.8 // no gültige Parameterliste for poly

proc poly a b c
// check type or. which Parameter present
if °a=="long" && °b=="long" && c==null
return "long-long-zero-> the Result a-2*b is: " + (a-2*b)
elseif °a=="string" && b==null && c==null
return a
elseif °a=="string" && (°b=="long" || °b=="float") && c==null
if °b=="long"
return "Übergabe: 1. Parameter Zeichenkette, 2. Parameter whole number"
endif
if °b=="float"
return "Übergabe: 1. Param. is Zeichenkette, 2. Parameter Dezimalzahl"
endif
elseif °a=="string" && (°b=="long" || °b=="float") && °c=="bool"
return "Parameter Passing: 1. Zeichenkette, 2. number, 3. Wahrheitswert"
else
return "sure incorrect Parameter indicated ??? "
endif
endproc

_____
Seinerzeit was too The question, whether one instead of var(a)=="long"
only var(a)==long
To write make possible could.
 
02/24/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

3.169 Views

Untitledvor 0 min.
Tommy03/29/22
Joeos07/23/16
pulverdieter05/26/16
Boroberto04/20/16
More...

Themeninformationen

this Topic has 1 subscriber:

HofK (1x)


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