PDA

View Full Version : Nested UDT (2: continue)



ErosOlmi
15-11-2007, 00:08
For those that followed previous thread about UDT here (http://community.thinbasic.com/index.php?topic=814.0), this is the continuation thread (previous one was too long and all topic covered there are already present in current thinBasic preview version 1.5.0.1).

Ok, here we are again with something new in UDT parsing.
Please find here attached an UNDER DEVELOPMENT version of thinCore.dll plus a test script that show current state of the art UDT parsing in thinBasic. I was able to add parsing of arrays of UDT and arrays inside UDT structures. There are not logical limits to how arrays of UDTs and arrays inside UDTs can be arranged. Parsing will recursively tokenize structures comparing with TYPE declaration.

This is a test version, so do not use for real scripts for the moment. I've made a lot of tests but as you know, testing is never enough so I expect you will find some uncovered cases.

Let me know.
Ciao
Eros

UPDATED:
2007.11.20

VARPTR now working with UDT inside UDT or any UDT element at any level. See included example.
SizeOf is now able to determine correct size of any element and sub element of any UDT or nested UDT. See included examples
attached file removed. All features present in current thinBasic version

kryton9
15-11-2007, 03:26
Eros, thanks as you know I have been dreaming about having these features. I will start to test things in coming weeks. Thanks for bringing this feature to us!

Petr Schreiber
15-11-2007, 09:58
Perfect Eros,

thanks a lot! Works great here so far!


Petr

Michael Hartlef
15-11-2007, 10:24
Man,

I can't wait till I can work on my computer again. Thanks Eros.

ErosOlmi
15-11-2007, 11:03
Just to let you know ... there are still items to be solved. For example (not exaustive list):


an UDT inside an UDT cannot be passed as function parameter
VARPTR is not able to return the exact memory position of an UDT inside an UDT
SIZEOF function to work also on UDT elements and nested UDT
UBOUND function to work on UDT elements and nested DLL too
...


There are other situations to check but I will be more precise in future posts.

Ciao
Eros

ErosOlmi
20-11-2007, 08:06
Attached file in first post of this thread updated.
VARPTR now working with UDT inside UDT or any UDT element at any level. See included example.


I will now work on passing any element or any nested UDT as FUNCTION parameter BYREF.

Regards
Eros

kryton9
20-11-2007, 08:25
Thanks Eros for tremendous task you undertook to bring us these features, looks like you are really getting it done in great Eros Fashion!

ErosOlmi
20-11-2007, 11:12
Thanks Ken.

It is a bit complex task this one but I'm sure it is myself making too much complex.
I'm discovering that I repeated the same code more then once so I'm confident I will be able to simplify UDT handling a lot and this will bring more easy to be maintained code for future implementations.

Ciao
Eros

ErosOlmi
20-11-2007, 23:43
Attachment in first post of this thread updated.

SizeOf function is now able to determine correct size of any element and sub element of any UDT or nested UDT.
See included examples.

kryton9
21-11-2007, 06:44
All 3 sample files ran fine, thanks Eros!

Petr Schreiber
21-11-2007, 14:44
Fantastic Eros,

did not found any problem with it yet.


Great work!,
Petr

Michael Hartlef
21-11-2007, 21:59
Fantastic Eros,

did not found any problem with it yet.


Great work!,
Petr


Same here. :)