Yoko

All sides of Injection
It is currently 2018-06-23 06:10:40

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Set/Get Global
PostPosted: 2005-06-27 12:46:30 
Offline
Expert!
User avatar

Joined: 2004-10-15 22:38:04
Posts: 1412
Location: Moscow City.
[table2start English Russian]
How can i set/get global variable?
(from 1 script to another)
[table2middle]
Как задать глобальную переменную?
(задается в 1 скрипте используется всеми)
[table2divider]
To do that we need 2 commands:
Code:
SetGlobal("Variable","Value")
GetGlobal("Variable")

First set global variable and it's value.
Secondly get value from first's.

Simple example:
[table2middle]
Для того чтобы работать с глобальными переменными нам понадобятся 2 команды.
Code:
SetGlobal("Переменная","Значение")
GetGlobal("Переменная")

Первая задает переменную и её значение.
Вторая возвращает (считывает) её значение.

Ниже приведен простейший пример реализации глобальных переменных.
[table2finish]
Code:
sub TurnOn()
UO.SetGlobal("BattleMod","On")
endsub

sub TurnOff()
UO.SetGlobal("BattleMod","Off")
endsub

sub Battle()
If UO.GetGlobal("BattleMod")=="On" Then
   UO.Print("BattleMod On")
else
   UO.Print("BattleMod Off")
Endif
endsub

Code:
Only for Russian Speaking countries. 
А все это есть в хелпе.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited