English
Regulars table & Café

Dim, a couple ask...

 
- Page 1 -



Jörg
Sellmeyer
the here functions. SizeOf determined too whom right worth. with String$(B#,0) becomes however nevertheless always the whole String outputted:
CompileMarkSeparation
Declare B#
Dim B#,11
String B#,0 = "0123456789"
Print Char$(B#,0,SizeOf(B#) - 1)
Dim B#,6
Print Char$(B#,0,SizeOf(B#) - 1)
WaitInp

Profanhilfe
The commands can ex XProfan 10 number of times on a Memory-Variable apply and be changes dynamic The Size the Speicherbereiches.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/30/08  
 



 
- Page 2 -


what has one NullByte with the Redimensionierung To do?

One Print String$(B#,0) is utterly not aussagekräftig there it here up to one NullByte let[ed].

If one in a area one zero-byte needed, because a function How string$ To there there let[ed], then ought to to the NULL-byte settle.

or kappier I only slightly not?
 
08/31/08  
 




Jörg
Sellmeyer
If Profan a area dimensioniert, reads String$(...) whom always up to correctly tuned Size the Bereichs from. the power But not any more, if the area new dimensioniert watts. the has nothing so To do, whether I one NullByte need, there the Abschlußbyte Yes otherwise too of Profan staid becomes.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/31/08  
 



Jörg Sellmeyer
If Profan a area dimensioniert, reads String$(...) whom always up to correctly tuned Size the Bereichs from.


won't mainly up to one byte 0 red?
 
08/31/08  
 




RGH
String$ reads until first byte(0), Char$ The angegebene amount characters.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
08/31/08  
 




Jörg
Sellmeyer
somehow turn we now in the circle, or? naturally becomes until first NullByte red. If dimensioniert becomes, becomes these byte but automatically on The latest place staid. Why ought to Dim the with the second application differently make. moreover has String$(...) so Access to memory, the already not any more to that Program heard. the ought to of my opinion not his. After the second Dim is the function String$ useful useless.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/31/08  
 




Frank
Abbing
Jörg has it just as said what's it like. the second String$ reads from unerlaubtem memory. The Redimensionierung is in this shape defective.
 
08/31/08  
 



It's all right means only therefore, with of/ one enhancement the Speicherbereiches, whom angehangenen part with zero To fill?
 
08/31/08  
 




Jörg
Sellmeyer
No!!! It's all right therefore, with of/ one Verkleinerung one Nullbyte einzufügen:
One area becomes declared:
CompileMarkSeparation
Declare Bereich#
>

Then it dimensioniert:
CompileMarkSeparation
Dim Bereich#,10
>

then sees area to my understanding so from:

0|0|0|0|0|0|0|0|0|z

where 0 too arbitrary data his can, The straight on the place in memory stand. its Yes not Clear area deleted.
now write I what mere:
CompileMarkSeparation
String Bereich#,0 = "123456789"
>

now should area so looks:

1|2|3|4|5|6|7|8|9|z

jetz new dimensionieren:
CompileMarkSeparation
Dim Bereich#,6
>

circa correctly To functions should area now so looks:

1|2|3|4|5|z

the memory behind it is now abgetrennt - the entire area ought to now so looks:

1|2|3|4|5|z7|8|9|z

Profan has means weder through Char$ - the with Überschreiten the Speichergrenze bleats - yet through String$ Access to WinXP? behind area.

The entire Speicherbereich sees but still so from:

1|2|3|4|5|6|7|8|9|z

otherwise had Profan none grabbed by String on the restlichen part.
If I again vergrößere, see it again so from (ought to):

1|2|3|4|5|z7|8|9|z

the Nullbyte is naturally still drin and now is the Programmer demand, its data sensible auszulesen/einzutragen.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/31/08  
 



the Redim can itself still but not on the string$ or char$ orientieren.

On memory, the not reserved is must not zugegriffen go - the must one now here but not mix up.

If one 10 byte Speicherbereich

HALLO WELT

on 5 byte redimensioniert becomes, then must the Result absolutely (and naturally)

HALLO

his, and not

HALLz

I find XProfan reacted here completely correctly - i'd it choking if it here WinXP? self changed.

what your want power one ultimately self, because one even not 5 separate 6 dimensioniert and the z-byte self into memory writes before one z.B. String$ drüberjagt...
 
08/31/08  
 




Frank
Abbing
iF understand it not yet, herje! Importent is, that Roland it understand.
Why becomes with one 5 byte grossen memory one 9 byte grosser Text into String copies? is still Real not sooo heavy...
 
08/31/08  
 



Frank Abbing
Why becomes with one 5 byte grossen memory one 9 byte grosser Text into String copies?


After welchem example? the here fractures correctly ex:
CompileMarkSeparation
 {$cleq}
cls
mem test=5
string test#,0="HALLO WELT"
print string$(test,0)
waitkey
e

Frank Abbing
Importent is, that Roland it understand.


have You The Thread chasing?

its still quite different. its dangerous The function String$ on a area loszulassen (if no further check include is) with the not ensured is, the it with a Nullbyte end. Dim however has here garnichts on Changes the Speicherinhalts To do...
 
08/31/08  
 




Jörg
Sellmeyer
No, its even not dangerous, there Dim whom area automatically with a NullByte abschließt. first one erneutes Dim power it dangerous. but I Have now everything said, I moreover To say have. should Roland itself consider, whether it Access to memory outside the program as bow or feature ansieht.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/31/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

27.811 Views

Untitledvor 0 min.
Michaeal03/21/12

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