954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Liberty Basic

Ok I have just finished the coding for this

'This is sub for when 5 is selected
Sub avg5
'Open comma delimited File
open "d:\Assign.txt" for input as #assign
Input "Please Enter a students ID ";stuid$
while eof(#assign)=0
Input #assign, id$,nme$,dob$,sub$,scr

If stuid$=id$ then

    totalscr=totalscr+scr
    nostud=nostud+1

        If nostud=1 Then
            Print " "
            Print "Swansea College BTEC Certificate for, "+nme$
            Print "Date of Birth " +dob$
            Print "Subject Results:"

        End if

    Print sub$+":"+str$(scr)+"%"




End if
Wend

    avgscr=totalscr/nostud
    PRINT " "
    Print "Course Average: "+str$(avgscr)+"%"
    Print " "

close #assign
End Sub


End

What I want to know is if there is a way to put an error onto this so that if someone enters in a wrong ID, its sohws them a error message, if you can post, what you think it is, I will be really happy, I think i will have to open another loop for the error message, but what do you think?

IceColdMan
Newbie Poster
3 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

I don't know Liberty BASIC (I know some JustBASIC, but...), so this might not help but:

If studid$<>id$ then
' open a form with an error



Does that work?

linux
Posting Shark
933 posts since Aug 2006
Reputation Points: 118
Solved Threads: 30
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You