English
Forum

Several Return values

 
- Page 1 -



Hubert
Binnewies
Hello together..

small trouble..
i'd me gladly a couple functions write The me the program on my derzeitigen proposition vereinfachen.
the stupid is only that I into most functions several Rückgabewerte have.

I Have The Help in XProfan through and always only seen the one with RETURN only a worth back give can.

or Have I there what overlooking?

How can I several values give back?

thanks Schonmal beforehand.

Hubert
 
WinXP Prof, XProfan 9.1 Newbie

Ein kluger Kopf sagte mal:
"Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!"
09/15/06  
 



 
- Page 1 -


Have here another example, without jegliche globale Variable. Simuliertes byRef
CompileMarkSeparation
Struct Long = l&

Proc Test1

    parameters a1&, a2&
    Declare B#
    Dim B#, Long
    B# = a1&
    B#.l& = 50  50 in c& von Test2 schreiben
    B# = a2&
    B#.l& = 100  100 in d& von Test2 schreiben
    Dispose B#  lokale Bereichsvariable wird nicht mehr gebraucht

EndProc

Proc Test2

    Declare c&, d&
    Test1 Addr(c&), Addr(d&)
    print "Wert von c& = " + Str$(c&) + "  d& = " + Str$(d&) + " in der Proc"

EndProc

Declare c&, d&
cls
Test2
Print
Print "Globales c& = " + Str$(c&) + "  Globales d& = " + Str$(d&) + " wurden nicht verändert!"
waitkey

Proc Test2 over gives whom Pointer of c& and d& on Proc Test1, which there 50 and 100 as Return enters. How one see, no global Variables and the area becomes too same disposed

hope time, the can someone use

// Nachtrag:
Have whom code yet something extended, so one sees, the it really goes

here again without Hilfsstructur, Have I not at all dran virtual, the it in Profan too so goes:
CompileMarkSeparation
Proc Test1

    parameters a1&, a2&
    Declare B#
    Dim B#,4
    B# = a1&
    Long B#,0 = 50  50 in c& of Test2 write
    B# = a2&
    Long B#,0 = 100  100 in d& of Test2 write
    Dispose B#  local Memory-Variable becomes not More used

ENDPROC

Proc Test2

    Declare c&, d&
    Test1 Addr(c&), Addr(d&)
    print "Wert of c& = " + Str $(c&) + "  d& = " + Str $(d&) + " in the Proc"

ENDPROC

Declare c&, d&
c& = 1
d& = 1
cls
Test2
Print
Print "Globales c& = " + Str $(c&) + "  Globales d& = " + Str $(d&) + " get not changed!"
waitkey

is Perhaps verständlicher
 
09/15/06  
 



Weils so beautiful is, yet The simplest Variante (Have so unfortunately yet To little made )
CompileMarkSeparation
Proc Test1

    parameters a1&, a2&
    Long a1&,0 = 50
    Long a2&,0 = 100

EndProc

Proc Test2

    Declare c&, d&
    Test1 Addr(c&), Addr(d&)
    print "Wert von c& = " + Str$(c&) + "  d& = " + Str$(d&) + " in der Proc"

EndProc

Declare c&, d&
c& = 1
d& = 1
cls
Test2
Print
Print "Globales c& = " + Str$(c&) + "  Globales d& = " + Str$(d&) + " wurden nicht verändert!"
waitkey
 
09/15/06  
 



Ähem - You änderst still nothing moreover as the value of global variables - and the too yet umständlich.
 
09/15/06  
 



[quote:a6584bda33=iF]Ähem - You änderst still nothing moreover as the value of global variables - and the too yet umständlich. [/quote:a6584bda33]
The variables in both Proc are pub, Proc Test1 changes The variables of Test2, Gleichnamige Globale variables stay too receive. functions so though not Strings. Globale variables go not changed

I commit whom Pointer and make a profanischen Poke
 
09/15/06  
 



Ne balderdash - You deklarierst two Globale - The änderst You in Proc - More not. your code is not without Globals The You uses.

or stand I aufm Hose?
 
09/15/06  
 



[quote:869f8d550b=iF]Ne balderdash - You deklarierst two Globale - The änderst You in Proc - More not. your code is not without Globals The You uses.

or stand I aufm Hose? [/quote:869f8d550b]
by me GEHTS::
CompileMarkSeparation
Proc Test1

    parameters a1&, a2&
    Long a1&,0 = 50
    Long a2&,0 = 100

EndProc

Proc Test2

    Declare c&, d&
    Test1 Addr(c&), Addr(d&)
    print "Wert von c& = " + Str$(c&) + "  d& = " + Str$(d&)

EndProc

Test2
09/15/06  
 



alas now! clear! Have the Declare in the second Proc overlooking!

Thomas wants say, simple The Adressen the variables on a Proc transfer, and the Variableninhalte by Long Change.
 
09/15/06  
 




Hubert
Binnewies
ööööööhmmmmmm.....

and if I no numerischen values separate Strings have??

(not so bad The Solution, can I use)

Greeting Hubert
 
WinXP Prof, XProfan 9.1 Newbie

Ein kluger Kopf sagte mal:
"Nach dem derzeitigen Stand der Technik ist es unmöglich Programme zu schreiben, die fehlerfrei laufen!"
09/15/06  
 




Rolf
Koch
only to expansion:
since Ewigkeiten schlummert under Own Codes folgenders on of my Page
More than a Parameter a procedure zurückliefern - New (19.03.2003)

one ought to too time on of my Page look *lol*
 
09/15/06  
 



 
- Page 2 -



Frank
Abbing
[quote:caee46f7de]and if I no numerischen values separate Strings have??[/quote:caee46f7de]
setting You Zeiger on Strings.
The List view.dll using already since langer Time for a few functions The engineering, The Thomas gepost has. Addressen of variables as Parameter. diverse APIs make it just as, z.B. OpenGL-APIs.
 
09/15/06  
 



i think times for longs is with the whom Pointern already ideal, for strings is the as an afterthought take apart, so How on Rolf its Page, or. of Roland addressed the simplest lane.

I personally likes namely not too gladly zuviele globale variables, particularly in grösseren Projekten is the sometimes verhängnisvoll

but in the Endeffekt, counts the success
 
09/15/06  
 




Frank
Abbing
correctly.. i think too, for Texts are reaches/Structures best suitable.
 
09/15/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.137 Views

Untitledvor 0 min.
Normann Strübli02/05/23
H.Brill11/05/22
RudiB.04/25/21
Michael W.08/16/17
More...

Themeninformationen



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