thought I was out of the woods

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

thought I was out of the woods

Post by magice » Sun Apr 19, 2009 11:46 pm

after all the trouble i had with saving and loading, now my app is broken when running from the stand alone. In my app the user creates imag map areas on a jpg image. He can then create other image map documents or description documents. from the links he creates. In the end he can export to html. The export script works perfect if runrev, but from the stand alone it does nothing. here is the code for the script:

Code: Select all

on exportToHtml
    global tMainArrayInc
   global tPassDocNumber
   global tMainArray
   global tMapAreaParses
   global tAdventureName
   ask "Please name your adventure"
   put it into tAdventureName
   --Creates folders  main html and mainmap description files
   do "create folder " & quote & tAdventureName & quote
   do "create folder " & quote & tAdventureName & "/docs" & quote
   do "create folder " & quote & tAdventureName & "/docs/maps" & quote
   put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD> "& cr &"<FRAMESET rows=" & quote & ",66%,33%" & quote & ">  "& cr &"<FRAMESET cols=" & quote & "66%,33%" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmap.html" & quote & " name=" & quote & "map" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmapnotes.html" & quote & " name=" & quote & "notes" & quote & ">"& cr &"</FRAMESET>"& cr &"<FRAME src = " & quote & "docs/mainmapdmnotes.html" & quote & " name=" & quote & "dmnotes" & quote & ">"& cr &"</FRAMESET>"& cr &"<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tIndex
   put tIndex into url ("file:" & tAdventureName & "/"& tAdventureName & ".html")
   put "<HTML>"& cr &"<HEAD>"& cr &"</HEAD>"& cr &"<BODY background=" & quote & "bg.jpg"& quote &">" into tNotesHead
   put "</BODY>"& cr &"</HTML>" into tNotesFoot
   put tNotesHead & tMainArray[mainmapnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapNotes.html")
   put tNotesHead & tMainArray[mainmapdmnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapDMNotes.html")
   do "revCopyFile " & quote & "images\bg.jpg" & quote & ", " & quote & tAdventureName & "\docs\bg.jpg" & quote
   --Creates Map Html Documents
   repeat with x =1 to the value of tMainArrayInc
      
      do "put tMainArray[" & x & "][tParentName] into tDocName"
      do "put tMainArray[" & x & "][mapfile] into tMapLoc"
      put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD>"& cr &"<BODY background=" & quote &"bg.jpg" & quote &">"& cr &"<IMG SRC=" & quote & "maps\" & tDocName & ".jpg" & quote &" USEMAP=" & quote &"#" & tDocName & quote &" BORDER=" & quote &"0" & quote &">"& cr &"<MAP NAME=" & quote & tDocName  & quote &">" into tHtmlHead
      put "</MAP>" & cr & "<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tHtmlFoot
      do "revCopyFile " & quote & tMapLoc & quote & "," & quote & tAdventureName & "\docs\maps\" & tDocName &".jpg" & quote
      put x into tPassDocNumber
      
      parseMapAreas
      parseNotes
      
      
      --Combines all parts of map and writes it to html document
      put tHtmlHead & tMapAreaParses & tHtmlFoot into url ("file:" & tAdventureName & "/docs/" & tDocName & ".html")
           
   end repeat
   
end exportToHtml
I know thats a lot, and i don't expect anyone to debug that since it works in runrev. My question is, is there a problem with using the ask command like i did since that is the first part of the script and the ask dialog doesn't come up when run outside of runrev.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Mon Apr 20, 2009 12:13 am

Just as a test you might go into the standalone settings and explicitly pick your inclusions such as the ask dialog etc, and see how things go.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Post by magice » Mon Apr 20, 2009 12:36 am

It was only a few minutes work, so i just made another stack to replace the ask dialog. Now it all works fine. I am just curious if anyone else has ever had trouble with the ask command running in windows.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Mon Apr 20, 2009 10:02 am

magice,
did you try what sturgis suggested?
That would also be my guess.
bernd

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Post by magice » Mon Apr 20, 2009 1:07 pm

No I didn't, but when i read the suggestion it was one of those "hit myself in the head DOH!" moments. By then I had already done the work around. I am sure his suggestion was right but since I was able to add a cancel option to my work around, it is actually better. Sorry to put you to the trouble of answering the post......Your answers are just so quick and easy to understand that this forum becomes a lazy mans first place to look. You guys are great.

Post Reply