8 hours ago
Hello Everyone
I am trying to create a grid layout with gdl. what I want is that the parameter I want is to be able to increase or decrease the number of grid lines and each time I add a grid line, a new parameter is created where I can adjust the distance between it and the previous grid line. At first I created 4 different grid lines and did the work in the program, but here I can create a maximum of 4 grid lines. what I want is to be able to create an infinite number of grid lines and I want to create a length parameter that I can change the value between each one I create.
Thanks...
25m ago
For this kind of thing you will need loops in your code.
And arrays (because you can not make up Parameters on the fly, meaning you need to have solution that is actually extensible).
for i=1 to n_of_lines
line2 0, 0, 0, B
add2 distances[i], 0
next i
Take this very rudimentary example. (please mind that this still needs some more code to work, e.g. handling consistency between "n_of_lines" and the distances array, so you don't run into errors, because the array is too small)
"n_of_lines" is your number of grid lines you want to appear.
Then you draw the line, and "add2" the distances to the next grid line.