AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page
   Networked Database  VBBS/VADV Script Discussion   [50 / 233] RSS
 From   To   Subject   Date/Time 
Message   Steve Winn    The Minstrel   Vscript variables..   July 14, 2002
 11:16 AM  

Re: Vscript variables..

> I'm having a bit of difficulty trying to figure out how to use the global
> array.  What I want to do is define the value of x0 as the channel number
> then use yx for a variable to do actual work so that folks running a script
> at the same time aren't overwriting each other's variable values (yep, I've
> seen it happen).  What *ought* to happen is that a user on channel 1's
> variables are y1 and z1 while a user on channel 2's variables are y2 and z2,
> and so on.  Any ideas?

What script have you seen that the user variables were overwritten from
another user using it? I've never have seen that happen.

As for the global array, here is an example of how you can use it above...

First, you don't really need to put the user channel number into a variable.
It is already contained in !12.

The array itself uses variables $1-$255. The dollar sign is what tells
vscript that you want to use the global array. Now the example here will work
if you are running less than 24 nodes and only require that each channel
needs to contain 10 variables or less.

So, we could make channel 1's variables 10-19, channel 2's variable 20-29,
etc. Now to access it we can do this:

LET x0 = !12 % "1"
? $x0

This would set x0 to be the channel number and 1 (if channel 1, it would be
"11";). The next line will print out whatever is in the array's position 11
(it uses the array because of the dollar sign).

You could of just done this instead to print out that array value:

? $11

But that isn't as effective as the first example though since if the user was
on channel 2, then that would be the wrong information to be printed.

Anyway this should help some. Still I haven't seen any problems with the
normal variables being overwritten because of other users (each user has his
own set of variables)... and my BBS is comprised of almost nothing but
scripts. Also my ATMatrix script uses the array if you need another example.

Let me know if you have more questions.

Steve

--
[AT2k] -- Your VBBS/VADV Support Center -- [www.at2k.org] -- [bbs.at2k.org]
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0152 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.1.241108