English
Forum

Done: Einfache Berechnung in nproc

 

E.T.

CompileMarkSeparation
 {$IQ}
Declare A&
A& = 120
cls
Print "Berechne : 100/";@Str$(A&)+"*100 :"
Print ""
Print "Ergebnis XProfan :",Rechnen_1()
Print "=============================================="
Print "Ergebnis nProc : ",Rechnen_2()
waitinput
end

Proc Rechnen_1

    Return @str$(100/A&*100)

EndProc

nProc Rechnen_2

    Global A&
    Declare X&
    X& = 100/A&*100
    Return str(X&)

ENDPROC


alike How I A& on nproc commit (as here global or by Parameter), it comes always 0 out
 
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...
03/22/10  
 



Native Profan is typenecht and (yet) without automatic Typenumwandlung (pay attention, übersieht one much quick!), with XProfan rechnest You supra Float and the Nproc ganzzahlig Long, if you supra with XProfan too ganzzahlig rechnest, kommts same out. could with Nproc but too Float calculate, käme too same out. ^^

for Ganzzahlige in Proc simply / through supplant, in nProc however there but (really) not - The Division depends itself to the Datentyp.

"Global" need neither, need one seldom ^^ - simply everything what need as Parameter transfer.

so wäres it "Real" and it funzt too, here time a couple Examples of Long and Float:
CompileMarkSeparation
Gemerkt/Separiert von http://xprofan.com/t/?8144
 {$IQ}
Declare A&,b!
A& = 120
B! = 120.0
cls
Print "Berechne : 100/";@Str$(A&)+"*100 :"
Print ""
Print "Ergebnis XProfan :",Rechnen_1(a&)
Print "=============================================="
Print "Ergebnis nProc : ",Rechnen_2(a&)
Print ""
Print "Ergebnis XProfan :",Rechnen_3(b!)
Print "=============================================="
Print "Ergebnis nProc : ",Rechnen_4(b!)
waitinput
end

Proc Rechnen_1

    parameters a&
    Return str$(100A&*100)

EndProc

nProc Rechnen_2

    parameters a&
    Return str$(100A&*100)

EndProc

Proc Rechnen_3

    parameters a!
    Return str$(int(100.0/A!*100.0))

EndProc

nProc Rechnen_4

    parameters a!
    Return str$(int(100.0/A!*100.0))

ENDPROC


deference: Floatkonstanten always with Dezimalpunkt indicate, native Profan has (yet) no automatic Typenumwandlung.

as String by Str$ müsstest at least for Print not give back, could too directly a& or a! give back - But vlt. solid. ^^
 
03/23/10  
 




E.T.
thanks, David. are How always a large Help (Have hold with the Assembler-Zeugs (yet) nothing on the hat).


If then time XPSE yet The restlichen things (z.B. for Gridboxen) can, learn itself too Assembler integrally well, I me happy times anschaue, what there so rauskommt...
 
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...
03/23/10  
 



clear, but vergiss not, that not task of NProcs is, Funktionalitäten the XProfan nachzubilden. sooner is it so, that one itself so functions write can, The not XProfan include are. otherwise, if one z.B. SetText for GridBoxen needed, then - so ists at least virtual - program one itself these function even self - means by NProcs and APIs and ASM where one it hold andenkt. necessary is ASM however not (More) - can imho now already "alles" with NProcs program - Yes even driver.
 
03/23/10  
 



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.894 Views

Untitledvor 0 min.
Peter Max Müller04/26/15
Georg Teles04/15/13
GDL04/14/13
Andreas Koch08/08/12
More...

Themeninformationen

this Topic has 2 subscriber:

iF (2x)
E.T. (2x)


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