English
Forum

really simply, only where is my fallacy (@MemPos) ???

 

Richi
Hi,
i want a Text with @MemPos multiple search. only with the Positionierung, the second request seem I a fallacy to have ?
CompileMarkSeparation
Declare Dateigröße%,Put$,Daten#
Put$ = "C:\Geladene-Seite.txt"
lesen:
Dateigröße% = @FileSize(Put$)
Print "Dateigröße% = ";Dateigröße%;" Bytes"
Dim Daten#,Dateigröße%+100
ReadText Daten#,Put$
'---------------------test-------------------------
declare pos1%,pos2%,start%,anzahl%,pos3%,pos4%
start% = 0
pos1% = @MemPos(Daten#,start%,"<")' Suche von von Position 0
pos2% = @MemPos(Daten#,start%,">")' Suche von von Position 0
anzahl% = pos2% - pos1%' Berechne die Zeichen zwischen den Fundstellen
print "von:";pos1%;" bis ";pos2%;" Zeichen gefunden: "; @Char$(Daten#,pos1%, anzahl%+1)' Ausgabe der gefundenen Zeichen OK
start% = pos2%+1' Zeiger an die letzten Fund-Position +1
print "start%=";start%
' ------------------------- AB HIER ???
pos3% = @MemPos(Daten#,start%,"<")' ERWARTE SUCHE VON POSITION 9  = start% ???????????????
pos4% = @MemPos(Daten#,start%,">")' ERWARTE SUCHE VON POSITION 9  = start% ???????????????
anzahl% = pos4% - pos3%' Berechne die Zeichen zwischen den Fundstellen
print "von:";pos3%;" bis ";pos4%;" Zeichen gefunden: "; @Char$(Daten#,pos3%, anzahl%+1)' Ausgabe der gefundenen Zeichen / Erwartet wäre:'<befehl1>' ???
Print "Waitkey"
waitkey
Dispose Daten#
end

my loaded-Page.txt:
CompileMarkSeparation
spending: Image in the attachment or see under

i'd expect the The spending me the following outputs:

<body>
<befehl1>

where is my fallacy or unterliege I a bow ??? I bastle there already two days around.

thanks for Help


13 kB
Kurzbeschreibung: spending
Hochgeladen:11/15/13
Downloadcounter0
Download
 
11/15/13  
 




Jörg
Sellmeyer
posx% is Yes no absolute worth, separate MemPos counts ex the new Startposition The Bytes To to next Fundstelle - here means 2.

so functions it:
@Char$(data#,start% + pos3%, number%+1)
You must means The position/start% always "mitführen".
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/15/13  
 




Jörg
Sellmeyer
I see - i don't know very, what You achieve want, but I would it so make:
CompileMarkSeparation
Var s$ = "<body>\n<befehl1>\n<befehl2>HELLO WORLD\n<befehl3>\n<befehl4><befehl5>\n</body>"
Declare Array$[]
Array$[] = Explode(s$,"<")

WhileLoop 0,SizeOf(Array$[])-1

    Case SubStr$(Array$[&Loop],1,">") > "":Print SubStr$(Array$[&Loop],1,">")

Wend

Wai
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/15/13  
 




Richi
Hello Jörg,

i want so what How in PHP The String-function strip_tags make, where any HTML command removes go.
Since I not any HTML command indicate would like etc would I simply everything between < and > from the Text Remove.

2. now had I probably too things How href left in the Text stand The ought to I naturally To to out search can

I have now My routine so knotted that I not any more durchblicke I catch mean once more tommorrow new on

for ideas and suggestions thanks too for your Help
 
11/15/13  
 




H.Brill
Perhaps help there too The regulären expressions,
about so :
Match$("<[a-zA-Z]{1,?}>", String$(area#, 0))

had to time try.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
11/15/13  
 




Jörg
Sellmeyer
Richi (15.11.13)

i want so what How in PHP The String-function strip_tags make, where any HTML command removes go.
Since I not any HTML command indicate would like etc would I simply everything between < and > from the Text Remove.


really could you then with my method everything in a list write. The can you then work out and your Text (i'd everything in a Stringvariable reading) courage Translate$() Edit.

Richi (15.11.13)

2. now had I probably too things How href left in the Text stand The ought to I naturally To to out search can


I kenn me there not so from - stand href-left too in pointed clinging (<href> </href>)? depending on, whether You The pertinent left keep want, can you then before whom code on The same point on href and /href parsen and the left by SubStr$() in a list reading.

Richi (15.11.13)

I have now My routine so knotted that I not any more durchblicke I catch mean once more tommorrow new on


the kenn I

Richi (15.11.13)

for ideas and suggestions thanks too for your Help


 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/15/13  
 




Jörg
Sellmeyer
with RegExp goes it too integrally simply:
CompileMarkSeparation
Var s$ = "<body>\n<befehl1>\n<befehl2>HELLO WORLD\n<befehl3>\n<befehl4><befehl5>\n</body>\n"
Var a$ = s$
Cls
Match$("<(.*?)>",a$)

While %matchpos > 0

    Print Match$("<(.*?)>",a$)
    a$ = Del$(a$,1,%matchpos)

Wend

W
ut
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/16/13  
 




H.Brill
Hello Jörg, very the meant I.
RegExp would I vorziehen, because one there already
The System-Variables $Match, &MatchPo, %MatchLen
always to hand has.
is too a swell thing in link with
@Translate$() and Instr(). If one then
yet on Rolands verlinkte Page (Help) goes,
becomes it yet interessanter.

PS: having too time to some Monaten something like
for Tags used :
CompileMarkSeparation
Declare String s
Declare String s1
Set("RegEx", 1)
Cls
s = "<img alt="
s1 = "<img 09abc8f="
Print Translate$(s, "<img [A-Za-z0-9]{1,}", "")
Print Translate$(s1, "<img [A-Za-z0-9]{1,}", "<***")
Waitkey
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
11/16/13  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.310 Views

Untitledvor 0 min.
H.Brill06/14/23
Sven Bader05/24/23
RudiB.09/02/22
Jörg Sellmeyer05/15/18
More...

Themeninformationen

this Topic has 3 subscriber:

Jörg Sellmeyer (4x)
H.Brill (2x)
Richi (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