jipete Posted November 15, 2017 Posted November 15, 2017 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
RTFC Posted November 15, 2017 Posted November 15, 2017 Do you mean Static declarations? Or allocate storage/data in a (fixed-size) struct? My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
jipete Posted November 15, 2017 Author Posted November 15, 2017 6 minutes ago, RTFC said: Do you mean Static declarations? Or allocate storage/data in a (fixed-size) struct? it's not static because i want to generate a random int number in my function
RTFC Posted November 15, 2017 Posted November 15, 2017 (edited) 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 November 15, 2017 by RTFC My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now