Page 1 of 1

differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 4:48 pm
by tyarmsteadBUSuSfT
This is the code that I am using and it works on the RunRev Development Test mode when I use the suspend development tools mode, but not when I place the app on my target iPad or IPhone.
on mouseUp
put the name of this card into gcurrentname
visual effect push left
go to card "SavedColorList"
put empty into field ColorList
Put empty into field ColorChoiceDetail
put empty into line 1 of field "Color(s)"
put empty into line 2 of field "Color(s)"
set the backgroundcolor of line 1 of field "Color(s)" to empty
set the backgroundcolor of line 2 of field "Color(s)" to empty
set the itemDel to tab
set the defaultFolder to specialFolderPath("documents")
put url ("file:" & specialFolderPath("documents") & "/colorlist.txt") into tColorList
answer tColorList (the answer is blank - when ran on the iPhone or iPad)
repeat with x = 1 to the number of lines in tColorlist
get item 1 of line x of tColorlist
put it into item 1 of line x of field ColorList
end repeat
end mouseUp

Re: differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 5:08 pm
by FourthWorld
What specifically do you mean by "doesn't work"? Does it throw an error? Does anything happen at all?

Re: differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 5:11 pm
by jmburnod
Hi tyarmsteadBUSuSfT,

I read your script and i don't see where is the mistake.
Maybe:
IOS is casesensitive. Check if file "colorlist.txt = "ColorList.txt" or something like that

Best regards
Jean-Marc

Re: differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 5:15 pm
by Klaus
Hi Ty,

I still don't see not any ANSWERs for debugging 8)

Try this and tell where what ANSWER dialog(s) you do NOT see in a standalone:

Code: Select all

on mouseUp
  put the name of this card into gcurrentname
  visual effect push left
  go to card "SavedColorList"
  
  ## NAMES of controls always in QUOTES!
  put empty into field "ColorList"
  Put empty into field "ColorChoiceDetail"
  put empty into line 1 of field "Color(s)"
  put empty into line 2 of field "Color(s)"
  set the backgroundcolor of line 1 of field "Color(s)" to empty
  set the backgroundcolor of line 2 of field "Color(s)" to empty

  ## Just to be sure :-)
  ANSWER "field init done!"

  set the itemDel to tab
  
  ## Not neccessary, since you use an absolute path in the PUT URL...!
  ## set the defaultFolder to specialFolderPath("documents")
  
  put specialFolderPath("documents") & "/colorlist.txt" into tColorFile
  ANSWER "file present:" && (there is a file tColorFile)
  ## Will give you FALSE if the file is not (yet) present!
  ## So you should EXIT the mouseup handler in that case!
  if there is not a file tColorFile then
    exit mouseup
  end if
  
  put url ("file:" & tColorFile) into tColorList
  ANSWER the result
  ## should be EMPTY on success
  
  ANSWER "Filecontent:" & CR & tColorList
   
  repeat with x = 1 to the number of lines of tColorlist 
    put item 1 of line x of tColorList into item 1 of line x of field "ColorList"
  end repeat
end mouseUp
Best

Klaus

Re: differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 6:30 pm
by tyarmsteadBUSuSfT
Klaus, it worked thank you. I did put an answer in the script put it was 4 lines from the end. I'm using answer all the time now.
Thank you again.

Re: differnce between Development mode and Standalone mode

Posted: Wed Jan 16, 2013 10:13 pm
by Klaus
tyarmsteadBUSuSfT wrote:Klaus, it worked thank you. I did put an answer in the script put it was 4 lines from the end. I'm using answer all the time now.
Thank you again.
And was was happening or got fixed?