English
Forum

String The Memory-Variable bring.

 

funkheld
Hello, I empfange now Data from the Clipboard.
The data stand Yes there as Text.
with:
Text$=getclip$()
have I the Text$ and Len undergo I The length.
now would like I the Text$ in a Memory-Variable settle circa a number auszuwerten. The String is really a Bytefolge and can't with "String" be read, because too in the middle drin a "0" stand can.

question:
How do I get whom Text$ into Memory-Variable to that evaluate?
I compiliere with XPSE.

Thank you.

greeting
 
05/10/12  
 




Jörg
Sellmeyer
Char processing too Nullbytes.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/10/12  
 



very, here helps The procedure char or use The rtlMoveMemory function.

XPSE-Kurzschreibweise:
string s="Mein Stringinhalt"
mem memory=len(s)
rtlMoveMemory(memory,addr(s),len(s))
//now is in the Memory-Variable "speicher" the Stringinhalt
dispose memory

or:
var s$="Mein Stringinhalt"
declare memory#
dim memory#,len(s$)
char memory#,0=s$
//now is in the Memory-Variable "speicher" the Stringinhalt
dispose memory#
 
05/10/12  
 




funkheld
Yes, thanks for Proposals.

greeting
 
05/10/12  
 




funkheld
Jup, I can now The Data from the Clipboard receive and spend.
If now this "if wert&=1" erfüllt is what about me The data ausgeprintet have, would like I joining 5 Zählwerte go on in the While-Loop. How are the?

Thank you.
 {$cleq}
declare ende&,Text$,area#,z&,laenge&,wert&
dim area#,128
ende&=1
Window 20,20-600,500

While Ende&

    sleep 5
    Text$=getclip$()
    clearclip
    laenge&=len(text $)

    if laenge& > 5

        char area#,0=Text$

        whileloop laenge&

            wert&=@byte(area#,&loop)

            if wert&=1

                print "tacho: ";
                print double(long(area #+&loop+1,0))

            endif

            if wert&=2

                print "bremse: ";
                print "bremse "+double(long(area #+&loop+1,0))

            endif

        endwhile

    endif

EndWhile

End
 
05/11/12  
 



Machste simply a Own Zählschleife z.B.:
var i&=0

while 1

    add i&,1

    if ...

        add i&,4
        continue...

or xpseischer:
long i

do{

    i++

    if ... {

        add i,4
        continue...
 
05/12/12  
 




funkheld
Jup, thanks. the functions.
I thought one can The Variable & Loop during the Ablaufes Change.

Why becomes to 10 durchläufen the word "ende" not geprintet?
 {$cleq}
declare ende&,zaehler&
ende&=1
Window 20,20-600,500

While Ende&

    sleep 5

    Whilenot 0

        sleep 5
        add zaehler&,1
        case zaehler& > 10 : continue
        print zaehler&

    EndWhile

    print "ende"

EndWhile

End
 
05/12/12  
 




Wilfried
Friebe
Hi

I have time a little bit changed though without XPSE
declare ende&,zaehler&
ende&=1
Window 20,20-600,500

While Ende&

    sleep 5

    Whilenot zaehler& = 10

        sleep 5
        add zaehler&,1
        case zaehler& > 9 : Ende& = 0
        print zaehler&

    EndWhile

    print "ende"

EndWhile

waitinput
End

Greeting Wilfried
 
Board MSI B450M BAZOOKA CPU AMD Ryzen 7 2700x 8 Core 3,7-4,2 GH 32 Gb Ram NVIDIA GeForce GTX 3060 12 GB Ram Window 11 Prof 64 Bit

Sun-Guru-Barebone CPU I7-9750H 16 GB Ram NVIDIA GeForce GTX1660TI 6 GB Ram Window 11 Hom 64 Bit

Profan 4.5 bis Xprofan 14
Ein frisch geschriebenes Programm hat meistens einen großen Fehler.Sollte man versuchen diesen großen Fehler zu beseitigen, hat man viele kleine Fehler "Grins"
05/12/12  
 




Jörg
Sellmeyer

Why becomes to 10 durchläufen the word "ende" not geprintet?


because You from this Loop not herauskommst:
Whilenot 0

    sleep 5
    add zaehler&,1
    case zaehler& > 10 : continue
    print zaehler&

EndWhile


with Continue spring You over ands over again on whom Schleifenanfang. Break breaks The Loop.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/12/12  
 




funkheld
Jup, thanks for different Solutions.

greeting
 
05/14/12  
 



Hi!

If itself from your visibility one your Topics "erledigt" has,
then the Topic simply as "erledigt" Mark.

then Better get going z.B. too with "Aktuelle Themen" (  [...]  ) as Done displayed.

For this simply under with whom "Themenoptionen" on "erledigt" clicking.

likewise can You Posts as "Lösung" Mark. the against goes if one
with the mouse over the "Mehr"-Button drives (eachone Posting has such Button under right)
and the option "Als Solution deklarieren" confirm.
 
05/14/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

12.183 Views

Untitledvor 0 min.
H.Brill10/17/22
RudiB.04/18/21
Normann Strübli06/07/20
funkheld12/14/13
More...

Themeninformationen



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