Gain Immediate access to our Essays
FREE access exchanged for your work, or pay £4.99
Words: | Submitted: Thu Sep 27 2007
... integer; VAR j, l: integer; c: char; valid: integer; Begin l:= length (vname); valid:= 0; FOR j:= 1 to 1 DO Begin If not (vname[j] in ['A'..'Z','a'..'z','-',' ','0'..'9']) then valid:= j; End; validatevname:= valid; If (valid<> 0) then Begin textcolor (red); gotoxy (12,19); Write( 'SORRY INVALID NAME '); delay (800); textcolor(blue); gotoxy (37,13); For j:= 1 to 1+1 Do Write (' '); End; End; {--------------------------------------------------------------------} {Ensures that the address entered by the user is acceptable or valid i.e. containing only letters and numbers.} Function validateaddress (address: string): integer; VAR j, l: integer; c: char; valid: integer; Begin l:= length (address); valid:= 0; FOR j:= 1 to 1 DO Begin If not (address[j] in ['A'..'Z','a'..'z'..,'#','0'..'9']) then valid:= j; End; validateaddress:= valid; if ( valid<> 0) then Begin textcolor(red); gotoxy(12,19); Write( 'SORRY INVALID ADDRESS '); delay(800); gotoxy(12,19); Write (' '); textcolor(blue); gotoxy(37,13); For j:= 1 to 1+1 Do Write (' '); End; End; {--------------------------------------------------------------------} {Ensures that the phone # entered by the user is valid i.e. contains only numbers, spaces or dashes.} Function validatephone (phone: string): integer; VAR j, ...
FREE access exchanged for your work, or pay £4.99