English
Forum

under-Proc recognize globale variables not?

 
XPSE can in the 1. Proc global angelegte variables discern. calls The Proc but another Proc on, follows The warning "Varibale undeklariert". One other product with X in front motzt not. Mach I what wrong?
 
01/20/12  
 



I see Yes: here the thing with the XPSE not wants. i'd it Yes later but gladly with nProcs speed, but wenn's so already not works?
CompileMarkSeparation
WindowTitle "Lexikographisch aufsteigende Permutationen eingegebener Wortstrings"
Font 2:randomize:cls rnd(8^8)
print " Trenner = Leerzeichen oder |, Durch negative Zahlen"
print " (zB. -9) werden Indexfolgen 0|1|2|3|4|5|6|7|8 permutiert."
print
' Interpreter: 9 Elemente 362880 mal permutiert in 148.81 Sek (ohne Ausgeben)
' XPIA:                       - '' -            in  28.55 Sek
' ProfComp                                      in  27.33 Sek
' $MAKE CLE
 {$cleq}
Declare t$,z&,tt$[],n&,tm&,ts$
var ausgeben%=0
Restart:
print " Zu permutieren (Leer oder | als Trenner):\n\n ";
input t$
t$=trim$(t$)
t$=translate$(t$,"  "," ")
case instr("|",t$):q$="|"
t$=translate$(t$," ","|")

if val(t$)<0

    setSize tt$[],-1*val(t$)
    tt$[]=str$(&Index)

else

    tt$[]=explode(t$,"|")

Endif

n&=SizeOf(tt$[])

if n&<2

    z&=0
    Goto "Skip"

endif

cls rnd(8^8)
print " Permutation läuft..."
tm&=&gettickcount
z&=PERM()' PERM ruft DOSOMETHINGWITHRESULTS auf!
' und verwendet dann NEXTPERM
tm&=&gettickcount-tm&
cls
print
ts$=" In "+str$(tm&)+" ms"
Skip:
ts$=ts$+" "+str$(z&)+" Permutationen erzeugt."
ClearClip
PutClip ts$
Print ts$
Print " Benchwerte in Zwischenablage verfügbar."
beep
WaitInput
CLS rnd(8^8)
Goto "Restart"
End

Proc DOSOMETHINGWITHRESULTS

    ' Hier: Ausgeben
    casenot ausgeben%:return
    case %csrlin>21: locate 1,1

    WhileLoop n&

        print tt$[&Loop-1];
        case &Loop=n&:continue
        print q$;

    EndWhile

    print

EndProc

PROC PERM

    Declare k&,j&,u&,v&,e%,z&,q$
    e%=1
    z&=0
    q$="|"

    While e%

        inc z&
        DOSOMETHINGWITHRESULTS
        NEXTPERM

    EndWhile

    return z&

ENDPROC

proc NEXTPERM

    'erzeugt die jeweils nächste lexikalische Permutation
    k&=n&-2

    While tt$[k&]>=tt$[k&+1]

        Dec k&
        case k&<0:break

    EndWhile

    if k&<0

        e%=0

    else

        j&=n&-1

        While tt$[j&]<=tt$[k&]

            dec j&

        EndWhile

        t$=tt$[k&]
        tt$[k&]=tt$[j&]
        tt$[j&]=t$
        u&=k&+1
        v&=n&-1

        While u&<v&

            t$=tt$[u&]
            tt$[u&]=tt$[v&]
            tt$[v&]=t$
            inc u&
            dec v&

        EndWhile

    href='./../../function-references/XProfan/endif/'>endif

endProc

 
01/20/12  
 



XPSE can something the XProfan self not power: Lexikalische variables Sichtbarkeit (  [...]  )

so is thereafter the following potentiell wrong:
CompileMarkSeparation
however correctly.:
CompileMarkSeparation
anyhow, nProcs are there even another bit strenger there there at all no Variablensichtbarkeitsvererbung existing too so nProcs always Thread-sure are. so Gibts in nProcs purposely only The therein deklarierten and as Parameter and by Global deklarierten variables but no from others nProcs or Procs.

PS: Codes Please in code-Tags settle.
 
01/20/12  
 




Nico
Madysa
i was so spare, it the Leserlichkeit To love To Edit.
 
01/20/12  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.983 Views

Untitledvor 0 min.
Pk02/24/17
Joerg04/22/16
Erasmus.Herold04/03/16
Ernst04/30/14
More...

Themeninformationen

this Topic has 3 subscriber:

unbekannt (2x)
Nico Madysa (1x)
iF (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