Page 1 of 1

Deploy application with many modules

Posted: Fri Dec 02, 2011 9:08 am
by QuangNgo
Dear all,

I am developing application using Livecode and facing problems how to deploy my application with many modules. Let me explain my application structure:
RIS folder
--Modules folder (which contains about 10 .livecode files for each modules).
--Template folder (which contains some templates as user want to email it)
--RIS.livecode(This file is used to start using this application)
As my lase experience, when I developed application I but all modules into only 1 stack so that's easy to deploy. However, as I decided to divided it into many modules by putting it into modules folder as you see above IT DOESN'T WORK.
Here are some code of my application
1.For Login Stack
global gAppLoc,gModulesLoc

Code: Select all

on preopenstack   
   put StackLoc() into gAppLoc
   put gAppLoc & "Modules/" after gModulesLoc
   put gModulesLoc & "StartUp.livecode" into tLibraryStack   (this stack is responsible for Authenticated)
   start using tLibraryStack   
end preopenstack
function StackLoc
   put empty into gAppLoc
   put empty into gModulesLoc
  put the filename of stack (the mainstack of this stack) into tName
  set the itemdel to "/"
  delete last item of tName
  return (tName & "/")
end StackLoc  


as I clicked on Login button

Code: Select all

on mouseUp
doLogin     
end mouseUp 
2.StartUp stack

Code: Select all

global gAppLoc,gModulesLoc
on preopenstack   
   put gModulesLoc & "DataAccessLayer.livecode" into tLibraryStack  
   start using stack tLibraryStack
end preopenstack
/*this method is use to check following below:
1.Authenticated User
2.Permission of User
    */
on doLogin
   --Authenticate successfully--
   put gModulesLoc & "MenuMain.livecode" into MenuMain   (Menu main for user to operate)
   open stack MenuMain
end doLogin
It's quite strange when I am excuting it while I am developing it that works fine but after built it into .exe doesn't work. Error say couldn't find handle doLogin
Could you guys please help me to fix this problems ? Thanks in advance

Regards,
Quang

Re: Deploy application with many modules

Posted: Fri Dec 02, 2011 12:09 pm
by Mark
Hi Quang,

You can simplify the way you retrieve the "location" of a stack (the actual term is the path to a stack). Examples:

Code: Select all

put the effective filename of this stack into myPath

Code: Select all

set the itemDel to slash
put item 1 to -2 the effective filename of this stack & "/Modules" into myFolderPath
You don't need to specify "of the mainstack of this stack" if you use the effective filename.

When you move a substack into its own file, the mainstack is no longer in the message hierarchy for that stack. Your Login button no longer sends a message to your StartUp stack. To solve this problem, you have to put the stack back into the message hierarchy with

Code: Select all

start using stack "StartUp"
I don't know why your stack still works while you're developing it. Maybe you forget to tell something. E.g. do you currently use substacks and do you tell the standalone maker to turn them into separate stack files? Do you have a start using command somewhere else?

Kind regards,

Mark

Re: Deploy application with many modules

Posted: Sat Dec 03, 2011 3:54 am
by QuangNgo
Hi Mark,
Thank you so much for your helping
I don't know how to explain so I'll send to you my application and you will see It's still working while you are developing but don't work once we deployed it

FYI,

Regards,
Quang

Re: Deploy application with many modules

Posted: Sat Dec 03, 2011 4:35 pm
by Mark
Sorry Qang,

I have no time to look into other people's projects because I'm too busy with paid work.

Better answer the questions I asked if you want me to help you or wait for somene else to download your stack and look into it.

Kind regards,

Mark

Re: Deploy application with many modules

Posted: Mon Dec 05, 2011 2:06 am
by QuangNgo
Hi Mark,

I'm so sorry for my request . I forgot that everybody has their own work. Anyway, I'm happy to talk with you

I'll find out the problems

Regards,
Quang

Re: Deploy application with many modules

Posted: Mon Dec 05, 2011 2:15 am
by Mark
Hi Quang,

Don't worry. You can always ask. Perhaps someone else wants to take up where I left.

Best,

Mark

Re: Deploy application with many modules

Posted: Thu Dec 08, 2011 10:41 pm
by Informatie
this is the code i'm using to included my mainstack.

on preopenstack
if "InformationLibrary" is not among the lines of the stacksInUse then
start using stack "InformationLibrary"
nzi_preopenstack -- my personal preopenstack
end if
if "DatabaseLibrary" is not among the lines of the stacksInUse then
start using stack "DatabaseLibrary"
nzd_preopenstack -- my personal preopenstack
end if
end preopenstack

The library files are in my plugin directory and when runrev is compiled for MAC or window the are included.

this is another link to more info klaus http://forums.runrev.com/viewtopic.php?f=8&t=7458

DJ

Re: Deploy application with many modules

Posted: Mon Dec 12, 2011 4:44 am
by QuangNgo
Hi Informatie,

Thanks a lot for your help. I also fixed my previous issues.

Thank you guys again,

Regards,
Quang