No subject

Ken Ray kray at sonsothunder.com
Mon Jul 25 09:15:48 EDT 2011


> The tendency of programmers to use non-human-like language for object names really drives me more than nuts. LiveCode allows for spaces in object and file names. Use them!

Mark, although I can appreciate your feelings about this, there are legitimate reasons one might not want to use spaces in object names:

1) It is more efficient as it takes less characters to type
2) You can quickly select the name of the object by double-clicking it
3) You can more easily distinguish object names from text strings when glancing through your code
4) Most other languages don't let you do this, so If you use multiple languages it would be better to have a consistent style across languages.

Just my 2 cents, 


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com


> 
> -- write
> put specialFolderPath("documents") & "/Defaults" into myPath
> // I don't know whether you need the next line, just let's be sure it exists
> if not (there is a folder myPath) then create folder myPath
> // mind that LiveCode allows for readable object names.
> // The same applies to files names. Use spaces!!!
> put myPath & slash & "Students Group" && the hilitedLines of fld "Group Theme Titles" into myFile
> open file myFile for write
> write fld "Students" to file myFile
> close file myFile
> 
> The read script is almost the same, using read from instead of write to. Note that I'm not using the defaultFolder because there is no need for it.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> What does that error mean? Buy LiveCodeErrors for iPhone now http://qery.us/v4 A must-have for LiveCode programmers. 
> 
> 
> 
> 
> 
> On 25 jul 2011, at 04:35, <gwendalwood at cox.net> <gwendalwood at cox.net> wrote:
> 
>> I did figure out how to get to writing and reading files on ios, but on my 
>> second app it does not work. I still can't figure out how to print from inside 
>> ios on the iPad 2. I think maybe it can't be done yet. 
>> I forgot to tell you my results. I get nothing in the variable it or the variable results
>> Following is my code snippets for files: 
>> ************** 
>> --write 
>> getPathsFromFile 
>>  put specialfolderpath("documents") into temppath 
>>  set defaultfolder to temppath 
>>  put temppath&"/Defaults" into newtempath 
>>  set defaultfolder to newtempath 
>>  put the hilitedlines of cd fld "GroupThemeTitles" into grpCount 
>>  put "StudentsGroup"&grpCount into temp1 
>>  open file temp1 for write 
>>  write cd fld "Students"  to file temp1 
>>  close file temp1 
>> 
>> -- read 
>>  put specialfolderpath("documents") into temppath 
>>        set defaultfolder to temppath 
>>     put temppath&"/Defaults" into newtempath 
>>     set defaultfolder to newtempath 
>>  put the hilitedlines of me into newgroup 
>>  put "StudentsGroup"&newgroup into temp1 
>>  open file temp1 for read 
>>     read from file temp1  until eof 
>>     put it  into cd fld "Students" 
>>     put the number of lines in it into studentcount 
>>  close file temp1 
>> 
>> 
>> **************
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list