Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

incrementations

Only working scripts
Post Reply
Kheelt
Neophyte
Neophyte
Posts: 10
Joined: 15.04.2014 0:41

incrementations

Post by Kheelt »

Since the new version "Inc" seems to throw exceptions. im wondering how you do incrementations now. Thanks.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: incrementations

Post by Vizit0r »

Code: Select all

program testprogram;
var  i : Integer;
begin  
   i := 5;
   Inc(i,5);
   AddToSystemJournal(i.ToString);
   Inc(i);
   AddToSystemJournal(i.ToString);
end. 
00:43:11:057 [Local - RunUO admin]: Compiling
00:43:11:097 [Local - RunUO admin]: Compiled succesfully
00:43:11:098 [Local - RunUO admin]: 10
00:43:11:099 [Local - RunUO admin]: 11
00:43:11:100 [Local - RunUO admin]: Succesfully executed
00:43:11:102 [Local - RunUO admin]: Script 11.sc stopped successfuly
no exception.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Kheelt
Neophyte
Neophyte
Posts: 10
Joined: 15.04.2014 0:41

Re: incrementations

Post by Kheelt »

It seems to be another part from the code "expected end, and it selects the line of the Inc();"

I'll see if i can fix it by my own.
Thans Viz.
Post Reply