English
Forum

XPSE - nProc seltsame Return

 
- Page 1 -



Georg
Teles
good evening,

now bastel I my Cryptsystem & under Anderem wished I one Source To something Ähnlichem here post and place solid, that with XPSE compiled programs in nativen Procedures with creep a worth always circa 7 larger give back as it his ought to...

here 2 Examples as Source:

with XProfan kompilierter Text, procedure gives right worth back (55619):
CompileMarkSeparation
Declare dat#,dat&,res&
Declare wert$
Dim dat#,8
CLS 0
Word dat#,0 = 9812,3484,60000,22315
res& = cryrst_(dat#,8)
wert$ = Str$(res&)
print wert$
Waitinput

Proc cryrst_

    Parameters ber#,ps&
    Declare s&,res&

    If ps& MOD 2 = 0

        s& = (ps&\2)-1

    Else

        s& = (ps&\2)

    EndIf

    WhileLoop 0,s&

        res& = res&+word(ber#,&loop*2)

        If res& > 20000

            res& = (res&-20000)

        Endif

    EndWhile

    res& = (res&+ps&)
    Return res&

ENDPROC


spot-on yourself code in XPSE, gives whom right worth the circa 7 larger is (means 55626):
CompileMarkSeparation
 {$cleq}
Declare dat#,dat&,res&
Declare worth$
Dim dat#,8
CLS 0
Word dat#,0 = 9812,3484,60000,22315
res& = cryrst_(dat#,8)
wert$ = Str $(res&)
print worth$
Waitinput

nProc cryrst_

    Parameters ber#,ps&
    Declare s&,res&

    If ps& MOD 2 = 0

        s& = (ps&\2)-1

    Else

        s& = (ps&\2)

    EndIf

    WhileLoop 0,s&

        res& = res&+word(ber#,&loop*2)

        If res& > 20000

            res& = (res&-20000)

        Endif

    EndWhile

    res& = (res&+ps&)
    Return res&

ENDPROC


there this a Statement ?
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

09/04/14  
 



« this Posting watts as Solution marked. »

In nProcs with declare declared variables haven't same the value 0,
The Variable becomes of course declared but it'll your no worth allocated and the worth
comes then from memory and can discretionary his.

differently is it (naturally) if one within nProcs with var declared z.B.
CompileMarkSeparation
var a&=20
>

or kürzer:
CompileMarkSeparation
long a=20
>
 
09/17/14  
 



Bereichsvariablenparameter are no nativ supports type,
übermittle times the address as Long. (means addr(ber#) instead of (ber).

After logischen Fehlern have I at Überfliegen not geschaut.
 
09/05/14  
 




Georg
Teles
went quick with the response

probiert, means
CompileMarkSeparation
res& = cryrst_(   Addr(dat#)   ,8)
...
nProc
Parameters    ber&   ,
pre>

the Result remaining same
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

09/05/14  
 




Georg
Teles
trouble resolved:

I observe, that it with XPSE it very important is, defined variables, with them one operates, on 0 or a worth To settle, whom one need...
CompileMarkSeparation
nProc
Parameters a#,b&
Declare c&,d&
c& = 0'auf 0 setzen
d& = 0'und hier auch
c& = c&+

now supply sowohl with XProfan compiled & gelinkte View source as well as with XPSE whom same korrekten worth
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

09/17/14  
 




E.T.
Hm, the in wonder me still something:
should whom new declarierte variables >Declare c&,d& < not really on "0", d.h. empty his ??

alas, see straight:
in the Eingans-Posting declarierst You res&  2x, once at Program-Start and then again in Proc / nProc.

with "Problem gelöst" declarierst You then in the "nProc-Schnipsel" c&  and b& , means new variables.
i think time, in the "Doppel-Declare" lying the bunny bury (ungetestet).

what me wundert is, the XProfan with your first example in the first mail not bleats, the The Variable already declariert is .

in the Help is go ahead reading


any variables, The in Procedures declared go, only there pub validly. The relative Speicherplatz becomes with leave the procedure again freigegegen


what happens, if in Proc variables declariert go, which already in the Hauptprogramm decl. get, the can us well Roland answer

Frag now Please not, Why very "um 7 more "...
... vlt. has IF Yes for this drop "Die glorreichen Sieben"  in XPSE installed
 
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
09/17/14  
 




Georg
Teles
E.T. (17.09.14)
alas, see straight:
in the Eingans-Posting declarierst You res& 2x, once at Program-Start and then again in Proc / nProc.
...
i think time, in the "Doppel-Declare" lying the bunny bury (ungetestet).


negative, have straight with others variables tested, selbes Result, exakt circa 7 larger if I The variables to the Declare not nulle

möglicherweise must no Variable 0 his and the Declare the "leeren Variable" the value 7 zuweist ?

E.T. (17.09.14)
what happens, if in Proc variables declariert go, which already in the Hauptprogramm decl. get, the can us well Roland answer


the would me but too interested, of my experience to goes pub to global, have in my Programs but never this Error made, only in Codesnippets tested
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

09/17/14  
 




RGH
If in a procedure variables declared go, also already in the Hauptprogramm declared are, then are The in the Hauptprogramm deklarierten variables in the procedure not visible, d.h. you can in the procedure weder red yet changed go.

Greeting
Roland
 
XProfan X2
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
09/17/14  
 



In nProcs with declare declared variables haven't same the value 0,
The Variable becomes of course declared but it'll your no worth allocated and the worth
comes then from memory and can discretionary his.

differently is it (naturally) if one within nProcs with var declared z.B.
CompileMarkSeparation
var a&=20
>

or kürzer:
CompileMarkSeparation
long a=20
>
 
09/17/14  
 




Georg
Teles
Ahh, many Thanks ! now are both ask clarified been.
With the Declare declared too, that in each Beispielcode end% to the Whilenot-Loop tradiztionell with Clear deleted or as var end% = 0 declared and to safety on 0 staid becomes.
these since Programmiertanfang on by me to that standard become because with my Programs often same variables number of times uses go, zB. temporary, but accurate hereon have I only yet never geschaut
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

09/17/14  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.802 Views

Untitledvor 0 min.
Normann Strübli03/31/20
funkheld02/09/16
Georg Teles01/07/16
iF06/01/15
More...

Themeninformationen

this Topic has 4 subscriber:

Georg Teles (5x)
iF (2x)
RGH (1x)
E.T. (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