stack structure

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
yarran
Posts: 5
Joined: Thu May 31, 2012 9:28 pm

stack structure

Post by yarran » Thu May 31, 2012 9:37 pm

> The application I want to develop somewhat mirrors a school in its structure.
> There are faculty subjects within the school BUT there are year levels within the
> subjects. I want to be able to move within the (year)levels as well as within
> the subject and between year levels.
>
> I presume that I can do this by moving from named card to named card. But how do
I
> implement this structure?
>
> Also, what is the best way to allow this movement?
>
> Can I implement the 'subjects' and/or 'levels' as substacks of the
mainstack('the
> school'). Or do the resources for each level or subject become a substack?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: stack structure

Post by dunbarx » Fri Jun 01, 2012 2:41 pm

I am not really sure what you are building, but it sounds like moving from dedicated cards within a single stack is best and simplest. Each card can be custom configured to hold whatever content you require.

As to the best way to navigate, again, what exactly are you trying to do? Choose among several options from a list and then go? If it is only the mechanics, as opposed to the structure, then this is very simple. But write back with more details.

Craig Newman

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: stack structure

Post by jmburnod » Sat Jun 02, 2012 1:26 pm

hi yarran,
You can use names of cards, controls and external files to create a systematic navigation.

For example you have:
•Two global variables gDisciplin = "biology" and gCurLevel = 1
•One folder "biology" with two files "biology_1.txt" and "biology_2.txt". This list define the content of flds, images, player etc…
•Two card "biology_1" and "biology_2"

Code: Select all

global gDisciplin,gCurLevel

--Use concatenation of global variables to get the name of the dedicated card
on OpenWishcard
   put  gDisciplin &"_"& gCurLevel into myWishcard
   open cd myWishcard
end OpenWishcard

on preopencard
   put the short name of this cd &".txt" into tName
   importLesson tName
end preopencard

-- Import the file about the current card
on importLesson pName
   -- define a path
   -- import the file from the path and organise data into the card
end importLesson

-- Setting global gDisciplin
on setDisciplin pName
   put pName into gDisciplin
end setDisciplin

-- Setting global gCurLevel
on setCurLevel pLevel
   put pLevel into gCurLevel
end setCurLevel
Best regards

Jean-Marc
https://alternatic.ch

yarran
Posts: 5
Joined: Thu May 31, 2012 9:28 pm

Re: stack structure

Post by yarran » Mon Jun 04, 2012 7:46 am

Craig,

Thanks for the feedback. I want to develop levels of complexity (like Russian dolls or an onion - peeling off layers into deeper ideas). I think the navigation will be easy enough with the livecode naming system. I am more concerned with how I structure this idea. There are many 'onions' in my model.

yarran
Posts: 5
Joined: Thu May 31, 2012 9:28 pm

Re: stack structure

Post by yarran » Mon Jun 04, 2012 7:48 am

Jean-Marc,

Thank you for your idea and the code!! It is good. I will have to give it some thought to see how closely it matches what I want to do.

Post Reply