@name new fileload test
@inputs CanLoad Loaded Loading Status
@outputs C Maxsize
@persist C Time
@trigger 
#This chip cycles loading 4 different files and displaying them
#it is meant to figure out the manner in which the updated file 
#functions work. 

if(first()){C=0 Time=curtime()}
CanLoad=fileCanLoad()
Loaded=fileLoaded()
Loading=fileLoading()
Status=fileStatus()
#interval(5000)
runOnFile(1)
print("CanLoad="+CanLoad+" Loaded="+Loaded+" Loading="+Loading+" Status="+Status)
if(Loaded){print(fileRead())}

Maxsize=fileMaxSize()

if(CanLoad){
    Reload=curtime()-Time
    Time=curtime()
    print("Can Load after: "+Reload)
    if(C==1){fileLoad("!.txt")}
    if(C==2){fileLoad("tested.txt")}
    if(C==3){fileLoad("!!test.txt")}
    if(C==4){fileLoad("contraptionlist.txt")}
    #if(C==5){fileLoad("nodegraph_2_gm_construct-xtreme.txt")}
    print("Load "+C)
     C++
    timer("load",5050) #approximate delay time between canloads. 
}
if(C>4){C=0}


#_FILE_UNKNOWN              = 0
#_FILE_OK                         = 1 - File uploaded successfully.
#_FILE_TIMEOUT               = 2 - File timed out when uploading.
#_FILE_404                       = 3 - File not found.
#_FILE_TRANSFER_ERROR = 4 - File did not upload correctly.

