
-----------------------------------
Il Lupo
Sat Sep 24, 2011 9:55 pm

Help with Retrieving Data
-----------------------------------
================================================================================
Issue:
====
I am creating a program for class that involves finding the mark of a person and then evaluating
it using an open/close program. To do this I incoporated arrays with the program. However, I can't retrive
any information from the text-file after inputting the mark. Therefore, I was wondering what the problem
may be - I assuming it is the way the loop has been setup but I am not sure how to fix it.

Program:
======
% Evaluates the mark of the student on what range there
% mark is or if they had failed.
var FileChannel : int
var evaluate : flexible array 1 .. 5 of string
var next : string (1)
var sum : real := 0
var mark : real
put "MARK EVALUATOR:"
put "---------------"
put "A = 80-100%"
put "B = 70-79%"
put "C = 60-69%"
put "D = 50-59%"
put "Fail = 49 & Below"
put "Note: -1 = Exit"
put ""
open : FileChannel, "F:\\SCHOOL\\ICS3U\\Turing 4.1.1\\Retrieve_Store\\Evaluate_Marks.txt", get
loop
    put "Mark: " ..
    get mark
    exit when mark = -1
    if mark >= 0 and mark = 80 then
            get : FileChannel, evaluate (upper (evaluate))
            new evaluate, upper (evaluate) + 1
        elsif mark >= 70 and mark = 60 and mark = 50 and mark 