VGAclocks


Author Message
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 437
Posted: 06:21am 06 Apr 2025      

  dddns said  Now I'm new to basic:
Is there a way, to use the content of a string as the variable name for the DIM command?
Is there a way to assign a value to a string, where the stringname$ is the content of another string?
I found a workaround with the "EXECUTE" command but maybe I can't see the obvious..

Hi dddns,
The fight with MMBASIC continues!
You are not alone in this fight,
I also miss the ALIAS NAMES FOR VARIABLES that exist in other programming languages.
For example, I would like to have:
1) ALIAS NAMES for VARIABLES
DIM D% = 123
ALIAS AlsD% = D%

and
2) ALIAS NAMES for ARRAYS with variable dimensions
DIM Arr2D%(100,1)
ALIAS Arr1%(100) = Arr2D%(100,0)
ALIAS Arr2%(100) = Arr2D%(100,1)

P.S.
Now in MMBASIC, something similar works inside subroutines and functions where, when defining, the name of the argument (parameter) is given, and when calling, the value of the variable is passed by reference.
Edited 2025-04-06 16:34 by javavi