English
Source / code snippets

Befehlszeilentrennung

 
- Page 1 -



RudiB.
Hello together,

I stand well at a for me sheer unlösbaren task.
i want one Program-Listing with Befehlszeilentrennung through Doppelpunkte, aufsplitten in self-contained Program lines.
as Sonderfall should however a row with "Case" or "CaseNot" to maintain go.

here time one utterly Sinnfreies Listing and thereafter the Listing bereinigt.
CLS
Declare a$,b$:Declare c$,d$
Declare e$:Print "Hallo \
together !":Declare INT GROBI: GROBI=500
a$=" the dog goes to that \
bright brennenden fires circa itself \
To wärmen: ABER!!\
The cat standing it in the lane"
b$="nicht LEER"
c$="Test"
d$="fertig"
Print:Print:Case b$="":Print" B is LEER":Print GROBI
Print c$,d$,GROBI
waitinput

...and so reserves then looks.....I utterly not hinkriege !!!!
CLS
Declare a$,b$
Declare c$,d$
Declare e$
Print "Hallo \
together !"
Declare INT GROBI
GROBI=500
a$=" the dog goes to that \
bright brennenden fires circa itself \
To wärmen: ABER!!\
The cat standing it in the lane"
b$="nicht LEER"
c$="Test"
d$="fertig"
Print
Print
Case b$="":Print" B is LEER"
Print GROBI
Print c$,d$,GROBI
waitinput

....z.B: on my own already the String VAR a$ with a colon therein position a challenge dar...because here too yet The eigentliche Befehlszeile with a Backslash aufgesplittet becomes...

here in the Forum becomes the first Listing with the Strings farblich not correctly displayed....

stand straight fully on the Hose...
can me here someone on The Sprünge help ???
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/15/22  
 



 
- Page 2 -



RudiB.
Yes Walter really so.....is already calm
however would like I a complete Befehlszeilen-Auftrennung (except Case/Casenot) ....
speak, too to one Case/Casenot should command separated go....
I knows Yes this is Tricky..difficult...sch..heavy.

but i think here can I fasten....
I need the for my proposition "VarFinder"....
Have there yet so many Baustellen open....

but thanks first....
Rudi
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/19/22  
 




Walter
my mistake - I fit the case/caseNot on, so it so runs, How You it need...
 
10/19/22  
 




Georg
Teles
Hmpf be confused, time Case with If supplant possible ?

so reserves looks
CLS
Declare a$,b$
Declare c$,d$
Declare e$
Print "Hallo \
together !"
Declare INT GROBI
GROBI=500
a$=" the dog goes to that \
bright brennenden fires circa itself \
To wärmen: ABER!!\
The cat standing it in the lane"
b$="nicht LEER"
c$="Test"
d$="fertig"
Print
Print

If b$=""

    Print" B is LEER"

EndIf

Print GROBI
Print c$,d$,GROBI
waitinput

here with Trennung
CLS
Declare a$,b$:Declare c$,d$
Declare e$:Print "Hallo \
together !":Declare INT GROBI: GROBI=500
a$=" the dog goes to that \
bright brennenden fires circa itself \
To wärmen: ABER!!\
The cat standing it in the lane"
b$="nicht LEER"
c$="Test"
d$="fertig"
Print:Print:If b$="":Print" B is LEER":EndIf:Print GROBI
Print c$,d$,GROBI
waitinput

Regards
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/19/22  
 




RudiB.
Hello Walter,

many Thanks for your trouble... is already not simply,,,,,
however have You very good Approaches......

my Test-Objekt-Listings/challenges here Forum are:
for example:
CPU-Simulation....https://XProfan.net/intl/de/Applications/8bit-cpu-simulation/

and  [...] 
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/19/22  
 




RudiB.
Hello Georg,

...thanks for your comment....

i don't know so really, whether I here konkret enough framed have.
I work still on my proposition "VarFinder".
there's it even important, Program lines To analyse..... speak the program must Befehlszeilen undo can.
straight in reference on If and Endif of/ one row, too this should aufgetrennt go can.
in this example GEHTS time only therefore circa a Programmformatierung sensible durchzuführen.
And so GEHTS moreover ......Problems...Problems...etc.
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/19/22  
 




Georg
Teles
Hmpf,

severe taken symbolize the colon already a new row with Case/Casenote
cls
var d%=2
case d%=1
print "asd"
case d%=2
print "dffff"
waitinput

means, that You through Parsen whom colon before entfernst and a new row from it make or depending on, whether You whom colon as new row interpretierst, time so as idea

Regards
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/19/22  
 




RudiB.
OK... mal as background for my Intension.
my Program "VarFinder" should any variables in a Program find can, speak in which row "Deklariert" in whom Lines comes tappt im dunkeln yet to, is tappt im dunkeln Global declared or comes tappt im dunkeln too still in of/ one "Proc" to etc.
gives it creep, inquire " If Endif"" etc.
For this, must I now time each Programmzeile auseinanderfieseln/decompose...
isn't straight simply...
I thought already I would almost on the target, however watts on the ground the reality gotten,as i in the Praxistest with Programs from this Forum, check had I still distant be of target......
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/19/22  
 




Georg
Teles
Puh, Yes then must akribisch row for row with Structures compared and decided go, what there vorliegt

simply sound not
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/19/22  
 




RudiB.
No simply certainly not ...however think I, that I on one good lane be.
there's with safety yet many Error in the program.....be but constantly thereby these auszumerzen...even on this ways and always in the hope the it somebody gives, the a new "PROFANE" idea reinwirft
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/19/22  
 




Walter
New attempt...
' the Codestück divides Befehlszeilen with ":" in new Lines on,
' except
'   a) the ":" is within one Stringliterals; or
'   b) to case/caseNot.
'      here remaining the first ":" with the subesquent commands in same
'      row receive.
' Kommentarzeilen are not berücksichtigt;
' The must ggf before ausgeschieden go
cls
Declare File$
declare StringAn%,i%,in$,out$,a$[]
declare AnzDP%
StringAn%=0
AnzDP%=0
Datei$=Loadfile$("ÖFFNE:","*.prf")
Assign #1,File$
reset #1
Print "Working.....Please Wait"

WhileNot EOF(#1)

    input #1,in$
    a$[]=explode(in $)' characters the Line in aray write
    'any characters the row go through
    for i%,len(in $)
    ' check, whether one itself within one Strings befindet

    if (a$[i%-1]=Chr$(34)) and (StringAn%=0)

        StringAn%=1

    elseif (a$[i%-1]=Chr$(34)) and (StringAn%=1)

        StringAn%=0

    endif

    if a$[i%-1]=":"

        ' case UND first : ?

        if (left$(trim$(lower$(out $)),5)="case ") or (left$(trim$(lower$(out $)),8)="casenot ")

            if AnzDP%=0' first colon - row continue

                out$=out $+a$[i%-1]
                inc AnzDP%

            else'row share

                print out$
                out$=""
                AnzDP%=0

            endif

        elseIf StringAn%=0' : isn't within one Strings - row share

            print out$
            out$=""

        else

            out$=out $+a$[i%-1]' : is within one Strings - row continue

        endif

    else' other characters as :

        out$=out $+a$[i%-1]

    endif

    endfor
    print out$
    out$=""

EndWhile

Close #1
Print "FERTIG"
waitinput
 
10/20/22  
 




RudiB.
the sees super from !!!

have the whole yet extended, so the ganzzeilige comments übersprungen and be Endkommentare first of all abgetrennt and be on the Schluss restored go.
Ausserdem as Besonderheit yet Sprungmarker, The on a colon terminate....
' the Codestück divides Befehlszeilen with ":" in new Lines on,
' except
'   a) the ":" is within one Stringliterals; or
'   b) to case/caseNot.
'      here remaining the first ":" with the subesquent commands in same
'      row receive.
' Kommentarzeilen are not berücksichtigt;
' The must ggf before ausgeschieden go
cls
Declare File$,End_Kommentar$,spending%
declare StringAn%,i%,in$,out$,a$[],pos%
declare AnzDP%,comment%
StringAn%=0
AnzDP%=0
Datei$=Loadfile$("ÖFFNE:","*.prf")
Assign #1,File$
reset #1
Assign #2,"Test_Datei.prf"
rewrite #2

While 1

    If (spending%<1) Or (spending%>2)

        Print "Bitte valid worth dial ( 1 or 2 )"
        spending%=Input$("1- on screen spend / 2- in File screiben","Bitte selection treffen",spending%)

    Else

        break

    EndIf

Endwhile

Print "Working.....Please Wait"

WhileNot EOF(#1)

    '-----------------------------------------------------------------------------------------------------------------------
    '          *ganzzeilige comments skipping
    '-----------------------------------------------------------------------------------------------------------------------
    input #1,in$

    If left$(trim$(in $),2)="/*"

        If spending%=1

            Print in$

        Else

            print #2,in$

        Endif

        comment%=1
        continue

    Endif

    If left$(trim$(in $),2)="*/"

        If spending%=1

            Print in$

        Else

            print #2,in$

        Endif

        comment%=0
        Continue

    Endif

    If (left$(trim$(in $),1)="'") Or (left$(trim$(in $),2)="//") Or (comment%=1)

        If spending%=1

            Print in$

        Else

            Print #2, in$

        Endif

        continue

    EndIf

    '-----------------------------------------------------------------------------------------------------------------------
    '          Endkommentare cut off
    '-----------------------------------------------------------------------------------------------------------------------

    If (Instr("'",Trim $(in $),2)) Or (Instr("//",Trim $(in $),2))

        pos%=0
        End_kommentar$=""

        Whileloop Len(in $)

            If mid$(in$,&loop,1)=chr $(34)

                pos%=hardship(pos%)

            EndIf

            If (mid$(in$,&loop,1)="'") And (pos%=0)

                End_kommentar$=Right$(in$,Len(in $)-&loop+1)
                in$=Left$(in$,&loop-1)
                Break

            EndIf

            If (mid$(in$,&loop,2)="//") And (pos%=0)

                End_kommentar$=Right$(in$,Len(in $)-&loop+1)
                in$=Left$(in$,&loop-1)
                Break

            EndIf

        EndWhile

    EndIf

    '--------------------------------------------------------------------------------------------------------------------------

    If right$(Trim $(in $),1)=":"' if letztes characters colon / Sprungmarker

        If spending%=1

            Print in$

        Else

            Print #2, in$

        Endif

        Continue

    Endif

    a$[]=explode(in $)' characters the Line in aray write
    'any characters the row go through
    for i%,len(in $)
    ' check, whether one itself within one Strings befindet

    if (a$[i%-1]=Chr$(34)) and (StringAn%=0)

        StringAn%=1

    elseif (a$[i%-1]=Chr$(34)) and (StringAn%=1)

        StringAn%=0

    endif

    if a$[i%-1]=":"

        ' case UND first : ?

        if (left$(trim$(lower$(out $)),5)="case ") or (left$(trim$(lower$(out $)),8)="casenot ")

            if AnzDP%=0' first colon - row continue

                out$=out $+a$[i%-1]
                inc AnzDP%

            else'row share

                If spending%=1

                    print out$

                Else

                    print #2,out$

                Endif

                out$=""
                AnzDP%=0

            endif

        elseIf StringAn%=0' : isn't within one Strings - row share

            If spending%=1

                print out$

            Else

                print #2,out$

            Endif

            out$=""

        else

            out$=out $+a$[i%-1]' : is within one Strings - row continue

        endif

    else' other characters as :

        out$=out $+a$[i%-1]

    endif

    endfor

    If spending%=1

        print out$+End_Kommentar$

    Else

        print #2,out$+End_Kommentar$

    Endif

    End_Kommentar$=""
    out$=""

EndWhile

Close #1
close #2
Print "FERTIG"
waitinput

have it then with the Source "CPU-Simulation" run.
it shining Fehlerfrei durchzulaufen...
 
XProfan X4
Xprofan X4
Rudolf Beske / München

Hardware: NB Intel I9 - 16GByte RAM
10/20/22  
 




Walter
this is but already very nice.
then plenty Happiness - and moreover so!
 
10/20/22  
 




Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.859 Views

Untitledvor 0 min.
Member 862464105/12/24
Cyberangle02/03/23
RudiB.02/02/23
Normann Strübli01/31/23
More...

Themeninformationen

this Topic has 3 subscriber:

RudiB. (13x)
Walter (8x)
Georg Teles (3x)


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