AdaNotes 2
When using an exception handler, if an exception is raised by the program, the system looks for an exception handler in the block where the exception was raised. If an appropriate one exists, it is handled AND THEN the block is exited. If there is no exception handler in the block where the exception was raised, the block is exited and an exception handler is searched for in the surrounding block. If the exception occurs in a called procedure and is not handled there, control transfers to the calling block and the exception handler is looked for there. Control does not return to the procedure that was exited.
If you decide to use a disk file, you must let the user enter the name. The safest way to do this is to declare a dummy string variable and fill it with blanks. Make the string variable that will hold the users file name and path the same length. Initialize your variable to all blanks. Prompt the user for his/her filename and store it in your string variable. If your program is unable to open the file, in your exception handler you should reinitialize your string variable by copying the blank dummy variable into it. Then you can reprompt the user for the filename and path. This will keep your string variable from having left-over characters, from the initial, unfound filename and path, from appearing in the new filename and path.
A get statement gets a value and the cursor stops when the value has been gotten.
The analog of new_line (which is used for put) is skip_line (which is used for get)
If you run into a problem picking up data because the data is erroneous, try using a skip_line before doing another get.
Ada is not case sensitive.
Ada doesnt let you pick up multiple values of a different type in the same get statement.
In this program you will need separate get statements to pick up a rank and a suit and separate put statements to print a rank and a suit
Ada has short circuit evaluation but its explicit not implicit
or else instead of or
and then instead of and
That is to say that the programmer determines whether the evaluation is to be short circuit or not
Short circuit evaluation stops evaluating the alternatives when one is reached that determines the result
A and b and c and d fails as soon as one of the a,b,c,d is false so short circuit evaluation stops at that point
A or b or c or d succeeds as soon as one of the a,b,c,d is true so short circuit evaluation stops at that point
The elsif requires only one end if
If else if requires an end if for each if
If ( ) then
else
if ( ) then
else
if ( ) then
else
end if
end if
end if
if ( )then
elsif ( ) then
elsif ( ) then
end if ;