'$include "C:\App\Comm\WC\Code\WC_Subs.WCC" dim FileRec as FileRecord, Dollar_Cost as real, Done as boolean dim FileNum as integer, Option as string, Rating as string dim Mark_File_Num as long, Mark_Index as integer dim Mark_Count as integer, Mark_Symbol as string dim File_Area as integer dim File_Area_Current as integer dim File_Area_Str as string dim FileRec_Prev as FileRecord sub File_Download ( FileRec as FileRecord ) REM ------------------------------------------------------------------ dim File_Path as string dim FileAreaRec as FileAreaRecord REM File_Path = FileRec.StoredPath if File_Path = "" then if GetFileArea ( FileAreaRec, FileRec.Area ) then File_Path = FileAreaRec.Path else Beep ? "Error: unable to find the file area path." ? "Please contact the SysOp to correct this problem." WaitEnter exit sub end if end if if not Exists ( File_Path + FileRec.Name ) then Beep ? "Error: the file could not be found." ? "Please contact the SysOp to correct this problem." WaitEnter exit sub end if if User.SubscriptionBalance >= FileRec.Cost then if ( File_Ratio < UserSec.MaxRatio ) or ( UserSec.SysopStatus > 0 ) then if SendFile ( File_Path + FileRec.Name ) then ? ? "Download successful." if FileRec.Cost > 0 then User.SubscriptionBalance = User.SubscriptionBalance - FileRec.Cost end if User.Downloads = User.Downloads + 1 UpdateUser ( User ) ? "File Ratio (Downloads/Uploads): "; File_Ratio ? "Maximum Allowable File Ratio : "; UserSec.MaxRatio ? "Account Balance : "; Dollars_Str ( User.SubscriptionBalance ) else ? ? "Download unsuccessful. Please try again or contact the SysOp." end if else ? ? "File Ratio (Downloads/Uploads): "; File_Ratio ? "Maximum Allowable File Ratio : "; UserSec.MaxRatio ? ? "To decrease your file ratio, please upload files or evaluate" ? "your previously downloaded files using EvalFile." ? ? "You will not be able to download this file at this time." end if WaitEnter else ? ? "This file costs "; Dollars_Str ( FileRec.Cost ); "." ? "Your account balance is "; Dollars_Str ( User.SubscriptionBalance ); "." ? ? "You will not be able to download this file at this time." WaitEnter end if end sub function Marked_File_Number ( FileRec as FileRecord ) as integer dim Marked_Index as integer if GetMarkedFiles > 0 then Marked_File_Number = 0 for Marked_Index = 1 to GetMarkedFiles if GetMarkFileName ( Marked_Index ) = FileRec.Name then if GetMarkFileArea ( Marked_Index ) = FileRec.Area then Marked_File_Number = Marked_Index exit for end if end if next Marked_Index else Marked_File_Number = 0 end if end function REM ------------------------------------------------------------------ REM ------------------------------------------------------------------ dim FileAreaRec as FileAreaRecord REM Color 15 print "Please let me know of the bugs in this new file lister! -- David Croft" print "Known problems: "; Color 14 ? "sluggish right now." Color 15 File_Area = 1 print while GetFileArea ( FileAreaRec, File_Area ) print FormatNumber ( File_Area, "#####" ) ; " "; print Pad ( FileAreaRec.Name, 30 ); if File_Area mod 2 = 0 then print end if File_Area = File_Area + 1 wend print print print "File area number (ENTER = All, Q = Quit, O = Old Lister): "; Input File_Area_Str File_Area_Str = UCase ( File_Area_Str ) if File_Area_Str = "O" then ListFiles end elseif File_Area_Str = "Q" then end else File_Area = Val ( File_Area_Str ) Done = false end if if GetFirstFile ( FileRec, 1 ) then if File_Area > 0 then do if FileRec.Area <> File_Area then if not GetNextFile ( FileRec, 1 ) then Done = true exit do end if else exit do end if loop end if do if Done then exit do end if Cls if FileRec.Name = FileRec_Prev.Name then if not GetNextFile ( FileRec, 1 ) then exit do end if end if File_Area_Current = FileRec.Area print "File Area "; print FormatNumber ( File_Area_Current, "#####" ) ; " "; if GetFileArea ( FileAreaRec, File_Area_Current ) then print FileAreaRec.Name end if print Color 11 print "["; Color 15 print "#"; Color 11 print "] "; Color 12 print "FileName.Ext "; Color 14 print "Rating "; Color 10 print "Cost "; Color 9 print "Byte Size "; Color 13 print "Uploader" Color 11 print "--- "; Color 12 print "------------ "; Color 14 print "------- "; Color 10 print "------- "; Color 9 print "------------- "; Color 13 print "-------------------------" print for FileNum = 1 to 5 Dollar_Cost = FileRec.Cost / 100.0 Color 11 print "["; Color 15 print FileNum; Color 11 print "]"; Color 13 if Marked_File_Number ( FileRec ) > 0 then print "* "; else print " "; end if Color 12 print Pad ( FileRec.Name, 12 ); " "; if Len ( FileRec.Description ) = 75 then Color 14 Rating = Right ( FileRec.Description, 5 ) if Rating = "+++++" then Rating = "1.00000" else Rating = "0." + Rating end if else Color 6 Rating = "?.?????" end if print Rating; " "; if Dollar_Cost > 0.00 then Color 10 else Color 2 end if print FormatNumber ( Dollar_Cost, "$###.##" ); Color 9 print " "; FormatNumber ( FileRec.Size, "#,###,###,###" ); Color 13 print " "; FileRec.Uploader Color 11 print " "; Mid ( FileRec.Description, 1, 70 ) print FileRec_Prev = FileRec if not ( GetNextFile ( FileRec , 1 ) ) then Done = true exit for elseif File_Area > 0 then if FileRec.Area <> File_Area then Done = true exit for end if elseif FileRec.Area <> File_Area_Current then FileRec = FileRec_Prev exit for end if next FileNum print Color 15 print "[#] File Number, [Q] Quit, [P] Previous Page, [ENTER] Next Page: "; input Option Option = UCase ( Option ) if Option = "Q" then Done = true elseif Option = "P" then for FileNum = 1 to 10 if not GetPrevFile ( FileRec, 1 ) then exit for end if next FileNum elseif ( Val ( Option ) > 0 ) and ( Val ( Option ) <= 5 ) then Mark_File_Num = Val ( Option ) for Mark_Index = ( FileNum - 1 ) to Mark_File_Num step -1 if not GetPrevFile ( FileRec, 1 ) then print "Error!" end if next Mark_Index print print "[D] Download, [I] Information, [M] Mark/unmark, [ENTER] Quit: "; input Option Option = UCase ( Option ) if Option = "D" then File_Download ( FileRec ) elseif Option = "I" then FileInfo ( FileRec.Name, FileRec.Area ) elseif Option = "M" then if Marked_File_Number ( FileRec ) > 0 then RemoveMarkFile ( Marked_File_Number ( FileRec ) ) else AddMarkFile ( FileRec.Name, FileRec.Area ) end if end if elseif Option = "" then REM Go on to next page. else Beep end if loop end if