English
Forum

@SizeOf / ReDim

 

Georg
Hovenbitzer
Hello together,

i sit time again in a trouble and understand The world not any more.
to the I there together program have, have I a couple ask but no Answer:
- wieso gives @SizeOf(Test#) 1 and not 11 from ?
- How come I on The real Size of Test# if I whom Return Value not have and @Sizeof not functions ?
- if I not Dim Dummy#,11 angebe or whom ReDim larger make as the Content, comes with the spending the Strings only Garbage out, wieso ?

sense or rather object the whole thing ought to his, I a area on a procedure commit and this filled back get without The final Size To Beginn to know.

Perhaps can me again someone help, so I The world again understand
CompileMarkSeparation
Proc ReDim

    Parameters ProcBereich#
    Declare Dummy#
    Dim Dummy#,20
    String Dummy#,0 = "0123456789"
    Dim Dummy#,11
    Dim ProcBereich#,@SizeOf(Dummy#)
    ProcBereich# = Dummy#
    Dispose Dummy#
    Return @SizeOf(ProcBereich#)

EndProc

Declare Size&
Declare Test#
Dim Test#,1
Size& = ReDim(Test#)
Print "Größe von Test# =",@SizeOf(Test#)
Print "Return Wert =",Size&
Print "Inhalt Bereich =",@String$(Test#,0)
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
11/18/09  
 




Stephan
Sonneborn
Hello Georg,

You dimensioniert Test# in your example with the length 1.
CompileMarkSeparation
Declare Size&
Declare Test#
Dim Test#,1re>

then call You The ReDim-function on. as Übergabe-Parameter verwendest You Test#.
CompileMarkSeparation
Size& = ReDim(Test#)
>

thereby points You ProcBereich# first of all too Test# To.
CompileMarkSeparation
Parameters ProcBereich#
>

thereafter setting You but ProcBereich# on The length of Dummy#:
CompileMarkSeparation
Dim ProcBereich#,@SizeOf(Dummy#)
>

and Dummy has The length 11 characters, because:
CompileMarkSeparation
Dim Dummy#,11
>

therefore becomes of your function always 11 back given.
CompileMarkSeparation
Return @SizeOf(ProcBereich#)
>

The SizeOf function in your Print-instruction beszieht itself the ursprüngliche Test#. and the has still The length 1.
CompileMarkSeparation
Print "Größe von Test# =",@SizeOf(Test#)
>
 
Schöne Grüße aus Wittgenstein
von Stephan

Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz
11/18/09  
 




Georg
Hovenbitzer
Hello Stephan,

your completions are correctly., but I have there Einwende
ex the 11it Version of Profan can on Procedures reaches transfer, I here try and what indeed works, in Test# is end the String "0123456789".

The question is now, wieso can I with @SizeOf not The changed Size detect ?
likewise interested me wieso the Content only correctly. is if The Size the Bereiches the the Inhaltes same is.

greetings
Georg
 
Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a)
11/18/09  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.853 Views

Untitledvor 0 min.
Ernst05/05/14
Tommy12/25/13

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