SRL Archive - OSR Help

Please help


mario_kn15

2013-07-14 14:48:55

please

Rich

2013-07-14 14:56:08

Which line is the one giving the error? I'm on my phone at the moment so can't tell.

mario_kn15

2013-07-14 15:09:35

From: Rich
Which line is the one giving the error? I'm on my phone at the moment so can't tell.


second line

Kasi

2013-07-14 15:14:01

please name your variables + procedures more with more intention :S also use standards?

your using function parameters wrong putting booleans where integers are supposed to be.
your putting semicolons in procedure parameters.
your assigning booleans to integers. you cant set a integer to false
you have internal errors. aka your assigning in boolean statements(if, untils etc) (using :=) instead of (=)

mario_kn15

2013-07-14 18:09:49

I fixed it, you can delete this thread:) thanks anyway

bob_dole

2013-07-14 23:28:52

From: Kasi
please name your variables + procedures more with more intention :S also use standards?

your using function parameters wrong putting booleans where integers are supposed to be.
your putting semicolons in procedure parameters.
your assigning booleans to integers. you cant set a integer to false
you have internal errors. aka your assigning in boolean statements(if, untils etc) (using :=) instead of (=)


For the sake of learning I would like to point out that in most programming languages and when using the Simba variable type 'variant' it is possible to use an integer as a Boolean or Boolean as an integer.

In some other programming languages a value of '0' or '-1' represent 'false' while numbers above 0 will represent 'true'. In Simba however, only a value of '0' will return false when used in place of a Boolean.

Here is a quick example to help aid understanding. If you are a programmer yourself, see if you can correctly guess what the output will be.


program new;
var
i: variant;
begin
i := 1;

if (i) then
writeln ('A');

if (i = true) then
writeln ('B');

i := 0;

if (i) then
writeln ('C');

if (i = true) then
writeln ('D');

i := -1;

if (i) then
writeln ('E');

if (i = true) then
writeln ('F');

i := 129632198321;

if (i = true) then
writeln ('G');

if (i) then
writeln ('H');

if (i <> false) then
writeln ('I');


i := false;

if (i = 0) then
writeln ('J');

end.

And our results:


A
B
E
F
H
I
J

Kasi

2013-07-15 02:39:48

From: bob_dole
possible to use an integer as a Boolean or Boolean as an integer.


For the sake of learning, yeah you can "use" an integer as a boolean or vise versa e.g BooleanX := not(IntegerY = 0);. but you are confusing pascal script with other languages. The variant datatype is a completely different datatype in pascal script. it takes on the characteristics of other datatypes such as booleans / integers / strings etc. so speaking from a more in depth view. booleans can not directly be assigned to integers in the same way integers cannot directly be assigned to booleans e.g BooleanX := 1; wouldnt work. in other languages you would be correct, but from a Pascal Script sense, in which the op posted, you are wrong. Kudos for explaining Variants regarding integers, booleans and doubles.

masterBB

2013-07-15 04:18:03

Where did you get that script. We don't allow it on our forum.

Rich

2013-07-15 06:23:08

From: masterBB
Where did you get that script. We don't allow it on our forum.


Why not? :confused:

Am I missing something?

masterBB

2013-07-15 07:36:41

From: Rich
Why not? :confused:

Am I missing something?


It is obfuscated. We do not allow obfuscated scripts.

Rich

2013-07-15 07:39:07

From: masterBB
It is obfuscated. We do not allow obfuscated scripts.

Ah, that. I thought you were referring to the actual function of the script. My bad.

Kasi

2013-07-15 11:21:11

From: masterBB
It is obfuscated. We do not allow obfuscated scripts.


Why do we have a obfuscate as a extension on simba?

Kevin

2013-07-15 11:41:33

From: masterBB
It is obfuscated. We do not allow obfuscated scripts.


Is that really all it takes to consider a script obfuscated? Using the formatter extension and then a replacement of the constants would make it look just like any other script here as far as I can tell.

From: Kasi
Why do we have a obfuscate as a extension on simba?


'Officially' for learning purposes. Unofficially to allow for ease of script obfuscation, privatization, and selling (although I DON'T think that was the original desire =/). However, as an open source community, anything public must also be open source and easily readable.

masterBB

2013-07-15 12:47:29

It is allowed to obfuscate scripts or sell scripts. You got copyright on what you wrote. But, it is not allowed on this forum.