My apologies: I assumed (!) familiarity with JavaScript (not Java, mind you - that's a programming language and a stimulating caffeinated beverage).The example that I posted assigned a word or phrase (a string of characters, called a ‘string’) to a JavaScript variable. Once you have the string in JavaScript, you are free to manipulate it: display it, incorporate it into a URL, whatever . . .
Going back to the example, paste in the extra Html and JavaScript lines shown below to see how it works:
================================================
< SCRIPT>
var xx = 'Hello' ;
window.external.ActivSet('avar',xx);
window.external.ActivRun("##MESSAGEBOX('variable is {avar}') " );
var yy = window.external.ActivGet('{avar}') ;
alert( "yy is " + yy ) ;
</SCRIPT>
Welcome. Your variable is:
<SCRIPT LANGUAGE="JavaScript">document.write(yy);</SCRIPT>
<p>
Goodbye...
================================================
The point of this fragment was to spell out the syntax for handling variables, using both Activ and JavaScript (and, by extension, Html). Follow the code, and you can see the syntax for using variables in both scripts.
This is what it does:
1) We store the string 'Hello' to the JavaScript variable 'xx' .
2) We assign the string within 'xx' to an Activ variable 'avar'.
3) We display the Activ variable ‘avar’ using Activ's 'Messagebox' function.
4) We assign the contents of the Activ variable 'avar' to the new JavaScript variable, 'yy'.
5) We display the JavaScript variable ‘yy’ using the JavaScript Alert() function.
...and, the crucial line you're looking for:
<SCRIPT LANGUAGE="JavaScript">document.write(yy);</SCRIPT>
6) We display the same JavaScript variable in the middle of a bunch of html.
So, your Activ variable value can be passed among pages, and displayed within your Html using JavaScript.
I should add this note: this is merely a demo of bouncing a variable back and forth between script types, and using it in both circumstances. You don't need to type all this in just to store a value to a variable. Just use one of the ways in the example: var xx='string', or the ActivSet and/or ActivGet commands.
Further, Sunil's DISPLAY command provides the Activ version of the same thing. Which method you use would most likely depend on what type of script you were building at the time.
I’m sorry I didn’t adequately explain this in the earlier post, and I shall attempt to be more explicit in the future. You are forewarned.
PS. I added spaces to the first < SCRIPT >, tag, 'cause it wouldn't display intact. Be sure to remove them if you copy and paste that line.
(Edited by Alaska at 8:28 pm on Sep. 11, 2002)