str2 : aliased string( 1 .. 4 ) ;
and then I could potentially access the address of each character in the string.
However, I cannot use "aliased" in an argument list and worse yet, since it is effectively a character array, it will be passed by pointer.
Here is a little snippet of what I am trying to do:
procedure double_draw ( row : in integer ;
column : in integer ;
word : in out string ) is
begin
for j in column .. word'length loop
input_pad(row,j).ch_ptr := word(j)'access ;
This is not going to work, does anyone have a suggestion of how I might work around this? My only solution right now is to move this to the calling code and simply pass the address of each character of a string
Thanks. So here is what I am playing around with. There is an ncurses Ada binding and a binding to a the Forms library but I am trying to do something a little different.
The basic problem is to collect user input and assign characters back to many string variables in one go.
I want to call a procedure to load each string into an intermediate data structure but I do not want to have to pass them all back to have their values to be updated. I figured with the screen co-ordinates and addresses I could avoid this.
I don't really want to start with pointer arithmetic or similar but I also need the strings to have their values updated without the second batch of passing .
Hi Everyone.
Happy New Year!
I am stuck with a problem. I have an application were I must use
pointers despite the fact that I try to avoid them. >
in the declarative section, I can write:
str2 : aliased string( 1 .. 4 ) ;
and then I could potentially access the address of each character in the string.
However, I cannot use "aliased" in an argument list and worse yet,
since it is effectively a character array, it will be passed by pointer.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 65:07:31 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,953 |
Posted today: | 1 |