SRL Archive - Help and Support

SCAR Dynamic Memory and Classes


Jackrawl

2008-06-04 14:07:25

I made a post in the scripting help section, but it got lost after someone claimed it was in the SRL Wiki, which it is not.

Apparently SCAR can use classes, which brings me to wonder about pointers and dynamic memory. Could someone please give me some examples?

Markus

2008-06-04 14:17:26

No pointers, no dynamic memory, no user created classes :( SCAR doesn't support them.
The reason the syntax highlighter bolds it is because it is a default highlighter for normal pascal.

n3ss3s

2008-06-04 14:23:53

What's the advantage of a class (in a separate file, right?) over a normal include file?

Markus

2008-06-04 14:26:55

Class as in OOP, not as in Java classes.

R0b0t1

2008-06-04 14:29:50

Well, Delphi's name is actually Object Pascal.

But you are pretty much using dynamic memory whenever you declare an array without a size, or you declare a string.

Jackrawl

2008-06-04 14:32:02

So no structs either?
What about FreeDTM and FreeBMP? It would seem like those wouldn't free anything if var didn't indicate a pointer, because integer reserves 4 bytes, short reserves 2, and so on.
From: n3ss3s
What's the advantage of a class (in a separate file, right?) over a normal include file?


Compile time and compact code.

Markus

2008-06-04 14:33:18

Just a handle to a value in an array internally used by SCAR.

Smartzkid

2008-06-04 23:11:38

Delphi supports them, though, right?

Bobarkinator

2008-06-04 23:23:06

yes

Freddy1990

2008-06-05 07:59:56

From: R0b0t1
Well, Delphi's name is actually Object Pascal.

But you are pretty much using dynamic memory whenever you declare an array without a size, or you declare a string.


Delphi's name is actually Delphi, the language it's based on is Object Pascal, but there are some distinct differences such as VCL

R0b0t1

2008-06-05 13:23:33

Ah, ok. I just remember they're similar.

Well, now that I think of it, you would really only need dynamic memory if you were going to use SCAR as an actualy programming language…

BenLand100

2008-06-06 05:14:55

From: Markus
Class as in OOP, not as in Java classes.

Are you going to try to tell me that Java classes are not a type of OOP ;)

Markus

2008-06-06 05:30:24

From: BenLand100
Are you going to try to tell me that Java classes are not a type of OOP ;)


Ofcourse not, but n3ss3s meant it as in files with code in general, not as in specific classes, and that's what I answered :)