Jump to content

reserve memory range for function ?


jipete
 Share

Recommended Posts

Hello i have question, it's possible to force it to reserve in my programme memory range for a function ?

Func _myfunction()
    Local var1="my data"
    Local $aArray1 = _StringBetween('[18][20][3][5][500][60]', '[', ']')
    _ArrayDisplay($aArray1, 'Default Search')
EndFunc

i want to store var1 and aArray1 to a memory range (of 1mb for example)

 

thank for advance for your help

Link to comment
Share on other sites

Do you mean Static declarations? Or allocate storage/data in a (fixed-size) struct?

Link to comment
Share on other sites

I think you might be confusing a Static with a Const(ant) declaration. Did you actually study the linked description? Static means that the function's local variable content is retained between calls to the function, thus (p)"reserving" this memory in a sense. Const, by contrast, just declares a fixed value (meaning if your script tries to change it later, an error is generated). However, if you mean pre-allocation in general, you can predefine your Global/Local $array[<max.number of cells ever>] or string with _StringRepeat(" ",<max.number of chars ever>), for example.

And by the way, Welcome to the forum.:)

Edited by RTFC
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...