[Gambas-user] Strange behavior when file.load() and Error dont Trap

Gambas User List gambas-user at lists.sourceforge.net
Sat Aug 27 03:34:06 CEST 2005


donald at ...1080... schrieb:

>
> Often i use code like following sample to load filecontent:
> ---- snipp ----
> PUBLIC SUB loadConfig()
>  config = NEW String[]
>  TRY config = Split(File.Load(ME.appPath & application.Name & 
> ".conf"), Chr(10))
>  IF ERROR THEN
>    saveConfig(TRUE)
>    loadConfig
>    RETURN
>  END IF
> END
> ---- snipp ----
>
> Normaly when the file not exist the Error-trap creates the file with 
> default content and reads it again.
> Since yesterday the Error-trap does not work, but jumps directly to 
> the end and Error has "?error = Syntax error"
> Also the file.load() works not anymore correctly even a file exist. 
> Strange is that this is not in all functions/subs.
> In some it works allways in others never. When i copy the code from 
> one wich does not to a working procedure, the code works again there. 
> And also the variable (in this case config) can have content but the 
> interpreter says it is a "Null object". If i open with Editor there is 
> enough content.
> Yeah, and i havent changed anything in the procedures between working 
> and not.
>
> Thanks for help
>
> Staudi
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle 
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing 
> & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
OK, solved the problem. Somwhere in the class i had the declaration "dim 
file as file". After i corrected, everything is OK.




More information about the User mailing list