Deploy application with many modules

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
QuangNgo
Posts: 60
Joined: Thu Mar 31, 2011 8:31 am
Location: HCMC VietNam

Deploy application with many modules

Post by QuangNgo » Fri Dec 02, 2011 9:08 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Deploy application with many modules

Post by Mark » Fri Dec 02, 2011 12:09 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

QuangNgo
Posts: 60
Joined: Thu Mar 31, 2011 8:31 am
Location: HCMC VietNam

Re: Deploy application with many modules

Post by QuangNgo » Sat Dec 03, 2011 3:54 am

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
Attachments
project.zip
(9.15 KiB) Downloaded 284 times

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Deploy application with many modules

Post by Mark » Sat Dec 03, 2011 4:35 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

QuangNgo
Posts: 60
Joined: Thu Mar 31, 2011 8:31 am
Location: HCMC VietNam

Re: Deploy application with many modules

Post by QuangNgo » Mon Dec 05, 2011 2:06 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Deploy application with many modules

Post by Mark » Mon Dec 05, 2011 2:15 am

Hi Quang,

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

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am
Location: Netherlands

Re: Deploy application with many modules

Post by Informatie » Thu Dec 08, 2011 10:41 pm

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

QuangNgo
Posts: 60
Joined: Thu Mar 31, 2011 8:31 am
Location: HCMC VietNam

Re: Deploy application with many modules

Post by QuangNgo » Mon Dec 12, 2011 4:44 am

Hi Informatie,

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

Thank you guys again,

Regards,
Quang

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”