HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... global variable
global variable
  View type:
Hi all,

I am trying to use a global variable which isn't instantiated or reset every page. I want to use it for some value I can change every page and which is then readable and changeable on the next (or previous) page.

I tried an action Variable myGlobal (scope: module) = 0 but then on every page this varable is reset to zero.

I understood it should be possibel by using a score, but I cannot get it going.
Anybody who can give me a small concrete example how to define this variable and how to access it on individual pages?

Thanks!
 
Hey Barend :)
Where or how are you setting up the global variable ?
Have you tried setting it in the module runtime settings?
Odd though, if you define a variable at the begining of a module, say to store a name then it's still there at the last page. So your variable ought to be OK.
It might be the way your writing to it.
There was a strand once that did cover this but I can;t remember the exsct details it was one of those really obvious when you know how kind of things though.
 
 
thx :-)
I defined a variable on the first page, set it to zero and made it available in the whole module. Then I found that on every page this variable is reset to zero.

hen I tried using 'score' but I could not get it running. It looks you and Jerry got it working I saw in a thread a few days ago), but I couldn't get the details right.

Thx again :)
 
 
 
Well the text variables are OK, you'll have seen Bob Prices simple intro to this.
http://www.friendsofcourselab.info/starter/start_base.html
This will work for direct user input.
I'm sure I have something using numbers somewhere but I'm not sure where as it was just one of those trivial extras. I'll have to wade through the modules I've made and see if I can find it.

As a function it would be useful in CD distributed media. I can do it with things like Matchware Mediator quite easily but thats a real 'swiss army knife' (has lots of tools) and lets you link to dbs which is really handy.
 
 
 
 
thx :-)
Monday I start working again and I'll look into it imm.
Subject:
Message options
No additional options