Empty files and Shift Lock

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Empty files and Shift Lock

Post by SteveHanlan » Wed Jun 15, 2011 4:50 pm

When I open a file that does not exist, all desktop versions return blank. Ios returns the name of the file.

i.e.

Code: Select all

put URL("file:accounts.txt") into accountlist
put the number of lines of accountlist into acctcount
on the desktop, acctcount is 0, on the iPad, it is 1

The obvious solution is to insert the line

Code: Select all

if accountlist="accounts.txt" then put "" into accountlist
after the 'put URL' line, but this should not be necessary

Also, with the keyboard set to default, the shift key acts as a Shift Lock on the iPad, (but not on the desktop versions)

Any ideas

thanks

Steve

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Empty files and Shift Lock

Post by Klaus » Wed Jun 15, 2011 5:25 pm

Hi Steve,

I'm not sure if this is correct behaviour, I never experienced this because
I always and ever check if a file exists before I try to read it! 8)

Code: Select all

...
if there is a file "accounts.txt" then
   put URL"file:accounts.txt") into accountlist
else
   put empty into accountlist
end if
...
Sorry, no idea about your keyboard question...


Best

Klaus

SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Re: Empty files and Shift Lock

Post by SteveHanlan » Thu Jun 16, 2011 12:22 am

Thanks Klaus

That will work just fine, it's just strange to have different behavior on iOS

Steve

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Empty files and Shift Lock

Post by Klaus » Thu Jun 16, 2011 12:00 pm

Hi Steve,

life is a compromise! 8)


Best

Klaus

Post Reply