I'm coming from Java/C++ to Ada and am having trouble figuring out the small stuff. Is it possible to declare an array and ask the user for the min/max values then initialize it? I don't like having to define constant values for the MIN and MAX and it seems like there should be a way to do this.
You can define an unconstrained type, but you still have to initialize the size in the declare block before your program starts. Would I need to have the package body, then the procedure declaration, then a declare block inside the procedure that actually does the work, like the following?
PACKAGE BODY Build_Graph IS
TYPE Graph_Box IS ARRAY(Integer RANGE <>, Integer RANGE <>) of Character;
PROCEDURE Print_Graph(Min, Max, Height, Width: IN Integer) IS
BEGIN
DECLARE
Graph: Graph_Box(0..Height, 0..Width);
BEGIN
Do_Stuf(Graph);
END;
END Print_Graph;
END Build_Graph;