DIM AT -- feature request - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: DIM AT -- feature request (/showthread.php?tid=1902) |
DIM AT -- feature request - Jack - 08-14-2023 PowerBasic has a very handy feature, the ability to dim at a certain address, for example suppose that you want to use a fixed-length string as a memory buffer DIM buff As String * 256 DIM m(31) AS _Unsigned Long AT VARPTR(buff) then you could access the array as usual but the values of the array m would be stored in the string buff since QB64pe lacks arrays in Type, you could almost have that flexibility if you had Dim At RE: DIM AT -- feature request - mnrvovrfc - 08-14-2023 The "DIM" statement presented there looks confusing. Therefore after many years I'm glad QB64 instead has _MEM and _OFFSET. I understand, use "m(1), m(2)" etc. to access portions in "buff", but yet this could be simplified with _MEMGET and _MEMPUT wrapped into convenience functions. Because we are all using 64-bit there would be no performance penalty for it. RE: DIM AT -- feature request - grymmjack - 08-15-2023 Hi @Jack I just stumbled onto this in the issue tracker: https://github.com/QB64-Phoenix-Edition/QB64pe/issues/354#issuecomment-1611346466 mechatronic3000 Wrote:I ran into a similar issue with my 2d physics engine. What I ended up doing is making the arrays into _MEM's (essentially making it a pointer) and I created some getters and setters to extract my data from the _MEM array. Code: (Select All)
This might help you as it helped me. |