Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / The Matrix1Utils plugins collection

Author
Message
Scraggle
Moderator
16
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 10th Jan 2013 14:23
Hi Ian,
I am making heavy use of the datafile commands but many of the files I have are UTF-8 and I need to read the strings from them (always strings) modify them and then save them back as UTF-8.
Is there any way I can do this? I suspect the answer is no but here's hoping!
MrValentine
AGK Backer
8
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Jan 2013 15:24
Scraggle... - might help to know which language text you are trying to manIpulate

GIDustin - any progress? did you try removing STYXs dlls alltogether?

Scraggle
Moderator
16
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 10th Jan 2013 20:28
Quote: "Scraggle... - might help to know which language text you are trying to manIpulate"


The language is irrelevant, the only thing of importance is what I stated in the post. The files come to me as UTF-8, I need to edit them and save them back as UTF-8.
MrValentine
AGK Backer
8
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Jan 2013 20:45
Fair enough, I would like to see how this one is handled... may come in use in future...

Westmere
9
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 11th Jan 2013 23:20 Edited at: 11th Jan 2013 23:23
IanM, thanks for your wonderful collection of extra commands

Two things though:

1. A crash problem, which I probably can't give you enough information to solve, but I guess you would like to know about it:
A person playing my game Cars Incorporated reported the game crashing with the following info:
AppName: carsinc.exe AppVer: 1.0.0.0 ModName: dbprobasic2ddebug.dll
ModVer: 1.0.0.0 Offset: 0000143b
(This looks a lot like some of those screenshots further up this thread.)
He was kind enough to send me a log-file my game has put out and I narrowed it down to the following sequence of commands:

CValue is a predetermindes RGB() value.

This codesegment works fine on my machine, as well as most others as this is the first report of this I had. I solved the problem for him by rewritting that part with non-Matrix-Util-commands (using an invisible bitmap) and it works fine. All that has been replaced are these three lines - with them it ALWAYS crashed at the same place, I don't know which of these commands caused it though.
The only other piece of info I can give you is as follows:

Found graphics card:ATI Mobility Radeon HD 4250 Graphics
Can do DirectX 9.0c with pixel shader 3 and vertex shader 3

...as read out by my game. I use this to see if shader model 3 and DX 9.0c is available.

Again no need to hurry with this, as I have worked around this. Unfortunately I can't help you test for this problem as it was never my system the error appeared on. Just thought you might wanted to know ^^

2. The second one is a request: Could you add a "Get Frontbuffer ImgNo, x1, y1, x2, y2" based on your "Save Frontbuffer filename$" command? So far it is apparently the only way to grab anything from a screen with Anti-Aliasing turned on by DBP. Of course any other variant of Get Image that grabs from an anti-aliased view would also be fine. You can find the latest of many discussions on this topic here.

Thanks for all your great work


Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Jan 2013 23:48
@Scraggle
UTF-8 strings will load and save fine already from DBPro since DBPro strings are just null-terminated arrays of bytes, so for most things it doesn't actually care what encoding is used. The problem comes when you want to display them.
I did a bit of research and there doesn't seem to be any easy way of displaying UTF-8 in DBPro. You could try calling TranslateCharsetInfo() passing in the UTF-8 code page and telling it to give you the equivalent charset value, which you could then pass as the extra parameter to "set text font", but I have no idea if that would even work...

[b]
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 2nd Feb 2013 10:20
I am using your logging commands and wondered what would be the safest easiest way to insert an index at the start of the log file which is HTML based; all in runtime?

I want to display this HTML file during debugging.

Should I use an external program to copy the file and parse the copied file into a new file for display? Or is there a better way?

Mobiius
Valued Member
16
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 1st Apr 2013 19:10 Edited at: 1st Apr 2013 19:19
Hello, I'm now having issues utilizing the invaluable matrix 1 plugins. I'm trying to create a high resolution plane, but I get the following run-time error:

Quote: "Runtime Error 1 - Broke from nested subroutine. Cannot resume program after CLI usage. at line 95"


I'm using DBPro version 7.62 with windows 8 x64.

Am I doing something wrong, or is it an incompatibility with either DBPro 7.62 or windows 8?


*EDIT*

Never mind, I've fixed it.

I moved my "The Game Creators" folder from Program Files (x86) to C:\ and it works now.

Lets see if it fixes my advanced terrain issues...

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 10th Apr 2013 14:17
A quick update on my bug report, I found that moving call function name to AFTER the text\print output will make the bug go away

UPDATED CODE WHICH DON'T PRODUCE THE ERROR:


The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Apr 2013 13:07
Weird. You get the same problem with the second form of the command:



(I added a second copy of the output just to show that the string itself hadn't been corrupted.)

I hope IanM reappears at some point.
Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 23rd Apr 2013 05:06
Quote: "I hope IanM reappears at some point."


Me too. There are some things I'd like to ask him about the implementation of a certain MAKE OBJECT NEW command

Clonkex

Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 14th May 2013 01:39 Edited at: 14th May 2013 02:28
Hey I got a really weird problem with the alloc and memory size functions.

At some point in my program I'm running this four lines:

Between this lines there is nothing else happening ... they are in the code exactly like that.
All variables I'm using are integers.
Text$ is never longer than 8 chars or something.

In a few cases I get a memory size of '-9' and I can't figure out why XD. Sometimes I get a memory size of -9 and sometimes I get something like 450551 which is definitely wrong XD.

Is there any situation when memory size possibly returns negative values or invalid values? XD

I'm using the alloc and memory size functions pretty frequent ... so maybe there is a bug left somewhere I don't know.
I honestly can't think of any reason why for example -9 should be returned by memory size.
I'm also using get string ptr and compare memory very often.

Here are some values I get:

It's obvious that the Sizes are invalid

I tried to recreate the problem with this code:

But actually I can't recreate it. I don't even ...

You can get the source code I'm talking about here.
The lines are in the function xvobject_text_make.
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th May 2013 13:29
Could your "vot" value be pointing outside the array's valid limits? That should flag an error unless it's been turned off.

The fact that you can't reproduce the bug with simple code makes me wonder whether the error is a side effect of an error somewhere else in the code. Just a thought.
Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 14th May 2013 16:28 Edited at: 14th May 2013 18:18
Thx for the help XD

But no ... the vot should be in range all the time.
The program doesn't crash.
Apparently memory size just messes up some values. XD

The funny thing is:
The pointers from the alloc functions are actually working, I can read all the values from memory just fine and even write without problems.
It's the fact that I can't get the memory size that messes things up for my system XD.
One solution I considered is writing my own size into the memory ( I already did that for VObject and VObject List, but because of the buffers ).

Actually the more I think about it the more I think the actual problems lies within "MEMORY SIZE".

I searched for the error endless hours now ... and I also tried different other methods ... but since I'm going for performance there aren't many.

This is the complete functions:



Actually really important is only this bit:


Well maybe there is even something fuzzy going on because I'm using the ptr to a normal dbp string:



But then again it doesn't have anything to do with the allocation and memory size.

I can also change the code to this:



PEEK STRING(vobject_text(vot) + 4) is printed out just fine.
It let's me write to the memory and read from it without a problem!
Just Memory Size is a jerk and gives me a bonkers value XD.

Btw.:
I asked this in several threads now ... and never got an answer XD:
How can I display my codesnippets in coloured text?
I saw that in other threads ... but I can't figure out how it works XD.

EDIT:
Maybe I should give some more information. If you are interested you can take a look here and as I said: Here is the source code.

In my system I'm handling text like this:
I want the text to exist only once in memory.
So every time I create a new text value for any of my objects I check if the text already exists within the text objects. If so I'm just pointing to the same text object.

Like that:
http://i.imgur.com/yN30FA1.jpg
Every text values in my system is handled like that, it's always a pointer to the text object.
The first 4 bytes of the text object is an integer count how often this text is pointed to.

Compare strings:
Now to speed things up I never compare strings themselves.
I compare the sizes of the text objects before I actually compare the memory of the strings.
I guess you know what happens.
If I compare -9 to 7 or whatever bonkers sizes memory size is giving me ... this can't be working.

Before you think it: XD
I'll probably go berserk in the near future and replace many of the integer values with word and dword values.
I haven't really thought of that early enough.

Performance:
This turned out to be pretty fast with reasonable amounts of objects.
Current Speed:
- Create 10.000 VObjects, one string attribute each -> 40 ms.
- Filter them by a string value -> 10 ms.

I never thought I would get this to be as fast as it is now XD ... and there is still room for improvement .

However, this memory size problem kind of messes up my string comparisons XD.

-> I uploaded the latest version of the source code.
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th May 2013 18:18 Edited at: 14th May 2013 18:26
Just a thought: what happens if you replace the array reference with a simple variable like this:



?

I'm wondering whether the function is using the wrong pointer, i.e. the pointer to the array rather than to the intended array element (but then I don't really know what's going on here ).

Edit

Deleted edit as it made even less sense than what I've just written.
Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 14th May 2013 18:31 Edited at: 14th May 2013 18:37
No difference at all. XD
It usually works for 99% of the strings.

Actually I just made some tests and the problems seems to be almost fixed ... and I don't even know what I did.
No matter how many text objects I create/link, today the program only messes up one of them sizes. lol

There is one thing I wonder:
What happens with the memory I allocated before the application crashes?
Does all the memory I allocate get freed again?
Could it be possible that my ram just had invalid registered chunks scattered all over the place? XD lol

I don't even know anymore XD
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th May 2013 18:45 Edited at: 14th May 2013 18:57
One more suggestion: what are the valid values for memory addresses? In other words what happens if the returned address is outside the DBPro integer range? I assume you should be using DWORDS not INTEGERS. Your code suggests you are using integers but I would expect ALLOC ZEROED(Size) to return a dword.

A simple test would be to define your return variable as a dword. Does the problem persist?

Edit Hmm? Some simple tests suggest that can't be the explanation either. We need IanM on this.
Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 14th May 2013 19:09 Edited at: 15th May 2013 00:19
That's one thing I thought about earlier ... but actually the ptr values aren't that big

-> "46.193.968" That's a ptr how I can get it. ( without the points of course )

Integer goes up to "2.147.483.647". That covers 2,14 GB if I'm correct.
However I never got a ptr "0" or say "500" or whatever, it's always somwhere around the same values.

I now created a double integer variable to get the ptr and I added it to my debugging output in the function to be able to compare the ptrs.
But actually they are exactly the same for the messed up strings. -_-"

So ... good idea, had it myself too ... but I'm afraid that's not it. XD

Don't get me wrong ... I will update my datatypes, even mentioned it somewhere in the recent posts, but for now that's not the problem so I don't care XD.

The one things that really bugs me is: It doesn't happen everytime or most of the time, but once or maybe a few times.
As a programmer these kinds of problems are my mortal enemies XD.

EDIT:
To be sure I also checked the TextPtr I got from "get string ptr" and it's also around the same size as the others.
I added it to my debugging print too.

EDIT2:
I made another attempt to reproduce this error and failed once again XD.
For now I reworked the function to this:


EDIT3:
I just realized it actually takes a lot of time to process "memory size". I mean with one or two calls you can't tell that ... but as frequent as I'm calling it ... it definitely is no good XD.

If I create 10.000 VObjects with 4 attributes each, two string, one double integer, one integer and filter them in a list "integer %var1 = 1" it takes 20 ms. Fast and fine!

I just commented out two "memory size" in my filter process to make this happen. Because with 4 attributes these two memory size calls make the difference between 20 ms and ~7,7 seconds.

I'M NOT LYING!

I got the feeling that "memory size" isn't exactly a stable function XD ... or at least it's not meant to be called that often.

So here's what I'm gonna do:
I will expand my "VObject Text" object a bit and have it hold it's own size value.
Also I'm gonna remove all memory size calls in my program XD. Let's see how that will work.

EDIT4:
I reworked big parts of my code so I can keep track of all my objects sizes myself ... and it's working like a charm now .
You should check it out.
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th May 2013 05:46
Quote: "How can I display my codesnippets in coloured text?"


[code lang=dbp



Shazam!
Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 17th May 2013 14:10 Edited at: 17th May 2013 14:13
Thx .



Mh, I see not everything is coloured. :/
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th May 2013 03:14
Hum, so I recently bought a new computer and got around to reinstalling all the TGC products.

The link in the opening post to the runtime library required by some of these dll's doesn't work any longer though so I was wondering if somebody know the exact version to download?
So far I've tried 6 different Visual C++ redistributable packages, all to no avail and I'd rather not drag more outdated junk than I need into my system folders...

Of course I could just download the individual missing dll files but I find it better to get the whole set.


Thanks for any help,
Rudolpho


"Why do programmers get Halloween and Christmas mixed up?"
Grasmann
11
Years of Service
User Offline
Joined: 1st Sep 2008
Location:
Posted: 20th May 2013 17:40 Edited at: 20th May 2013 20:21
I don't know XD. All I know is that you need those:
- MSVCP71.DLL
- msvcr71.dll <- 71 = VS 2005?
- msvcp100.dll
- msvcr100.dll <- 100 = VS 2010?

I got another problem: This time with the "FREE" memory command.
I'm creating a lot of memory chunks via "ALLOC" in my project suddenly the program began to crash in the middle of operations that were working the whole time.

I tracked the crashes down to a "FREE" memory command.
I'm pretty sure there is no error in my code.

The funny thing is I can fix this reliably if I change the creation code of this particular memory chunk to this:

Instead of this:


So to make this clear:
If I don't alloc the memory chunk twice and free it in between the program will crash if I'm trying to free it later on.
That's what I call strange ... I can't really think of any reason XD.

Btw.: I checked the Ptr and it's not changing between the "ALLOC" and the "FREE" commands.

EDIT:
I just removed the two additional lines again and the error seems to be fixed now. >_> But I haven't changed anything else.
There are now two possibilities I can think of:
1. "ALLOC" and/or "FREE" command(s) are sporadically unreliable.
2. A Compiler error that resolved itself when I edited the source file. o.O
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 21st May 2013 01:20
Yeah I know.
I don't think the 71 one is from VS2005 though; have that, 2003, 2008 and 2010 now...
Oh well, I finally just downloaded the files (turned out they were much fewer than I recalled, or maybe the rest were indeed installed by the VC redists).


What crash message (if any) do you get (access denied trying to read / write #xxxxx etc.)?
Off the top of my head I would hazard a guess that you might free the memory more than once by accident, if you are sure your pointer addresses are indeed the same at all points in time.
You could try to always set your pointers to null (0) when freeing them, in that case you should get more accurate null pointer exceptions. Or well, the free function will not do anything rather I think in this case, but that works too even if it doesn't help you fix the misplaced deallocation.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st May 2013 01:20
Quote: "The link in the opening post to the runtime library required by some of these dll's doesn't work any longer though so I was wondering if somebody know the exact version to download?"


Do you mean this one (from the Bug Reports board)? It seems to work as far as I can tell.

The DirectX Web Installer
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 21st May 2013 01:26
Haha, sneaky post GG.
I already have DirectX installed (for some odd reason the ninth version seemed to be included with the factory installed content on this computer, has never happened before), this was about some additional dll's required by this plugin. Supposedly they are related to .NET.


"Why do programmers get Halloween and Christmas mixed up?"
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 27th May 2013 13:47
It seems that the Limb Position vector command isn't working. It returns zero in this example:



Paronamixxe
AGK Bronze Backer
7
Years of Service
User Offline
Joined: 10th Feb 2012
Location: Sweden
Posted: 16th Jun 2013 23:23 Edited at: 16th Jun 2013 23:25
I cant seem to get the command
to work...

As I understand it, I am supposed to call
if I want to replace the current value of the key "Created" in my INI_Save_1 ini file. **according to the help docs...**


I am calling the set lookup command like this:
and my ini file looks like this:
yet everytime I try it, I dont get an error or anything, but the value is not changed.

Thanks in advance! //Anton

Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 16th Aug 2013 07:15
In reading Matrix1Util_21, would it be worth having a "Disable Zone", "Enable Zone","Disable All Zones", "Enable All Zones" commands? That way a zone isn't deleted, but rather just disabled.

Any thoughts?

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 17th Aug 2013 20:44
Wow, it is pretty quiet in this thread.

Quote: "As I understand it, I am supposed to call ... set lookup ... if I want to replace the current value of the key "Created" in my INI_Save_1 ini file. **according to the help docs...**"


Not quite; you have only set the lookup value, not the value in the INI file. You must call theSave Lookup To Ini function so that the entire lookup library is saved to file.

Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 26th Aug 2013 13:09
Just for the record; Copy Vector4 will not work when a vector4 result was created by the New Vector4 command:

This did not work:



This did:



Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 2nd Sep 2013 10:52
Would love to know why IanM disappeared. Actually quite sad. He's the only reason I can actually create my secret project; he taught me just about everything I know about plugin creation (that's right - my project is a DBPro plugin ).

Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 6th Sep 2013 03:12
Yeah, I hope he's OK. Is he posting anywhere else on the forums (or the internet for that matter)?

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Oct 2013 00:34
I'm all OK, not dead, not in jail, not ill (apart from a bad back ATM ).

I just needed a short break, which somehow turned into a long break, then an even longer break.

I am getting a slight itch to start coding again, so we'll see where that gets me...

Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 4th Oct 2013 04:30
Quote: "I'm all OK, not dead, not in jail, not ill"


Wow. Never thought you'd be back! Good for you!

Quote: "apart from a bad back ATM"


Not so good for you!

Quote: "I just needed a short break, which somehow turned into a long break, then an even longer break."


That's fine, sometimes you just get sick of programming and have to do something different for a while.

Quote: "I am getting a slight itch to start coding again, so we'll see where that gets me..."


Cool, I'm curious to see what comes of this

GIDustin
11
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 4th Oct 2013 04:32
I am slightly depressed by your news IanM. I had thought Lee had you working on some super-secret project (DBPro Elite).

Glad to have you back though!

Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 4th Oct 2013 05:03
Quote: "I am slightly depressed by your news IanM. I had thought Lee had you working on some super-secret project (DBPro Elite)."


lol hahaha

BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Oct 2013 10:13
Welcome back

Hang on...TheComet gets banned for pony related incidents, Ian returns...mmmm

Scraggle
Moderator
16
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Oct 2013 16:09
Quote: "I am slightly depressed by your news IanM. I had thought Lee had you working on some super-secret project (DBPro Elite)."

Me too

Quote: "TheComet gets banned for pony related incidents, Ian returns"

Has anyone every seen them in the same room together?
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 6th Oct 2013 02:24
Welcome back; I have been having a great deal of fun with your plugins while you where away.

Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 11th Oct 2013 08:52
IanM! I was legitimately worried for you! I checked your website, I almost emailed you, I, I, I....

Quote: "I am getting a slight itch to start coding again, so we'll see where that gets me..."


SHUTUP AND TAKE MY MONEY!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 14th Oct 2013 07:24
Green Gandalf
VIP Member
14
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Oct 2013 00:29
Welcome back IanM.

Now where did I put that list of awkward questions ... ?



Powered by Free Banners
Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 18th Oct 2013 04:33
Yeah, I'm curious if you've got a road map planned out for Matrix1 Utilites? The last feature enhancement I was requesting was for the ability to disable zones, as opposed to outright deleting them.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Oct 2013 19:21
I think calling what I have in mind for the utilities a roadmap implies an actual plan. So no, no roadmap as such, just a few little ideas fizzing around in my head. Any suggestions would be welcome.

To disable a zone, you can move it into a different group and use the POINT IN ZONE GROUP function instead of the POINT IN ZONE function to do your checks on your active group. Move the zone back to re-enable checking.

Quote: "Hang on...TheComet gets banned for pony related incidents, Ian returns...mmmm"

'Mmmm'? Sounds like you like the taste of ponies too - Barbequed is best.

Clonkex
Forum Vice President
9
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 20th Oct 2013 05:41
Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 22nd Oct 2013 08:35 Edited at: 22nd Oct 2013 08:45
Hey Ian,

What are your thoughts on the below technique? Are you making a frowny face, or is their potential for a feature enhancement here?



Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Oct 2013 12:54
What are my thoughts? Don't do it, unless you know what you're doing (ie writing variadic functions, and using arglists).

After the code is compiled, there's no way to tell the type or number of arguments required by the function, or even if a value is returned.

When you dip into function pointers, it's your responsibility to get the code right.

Burning Feet Man
11
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 22nd Oct 2013 22:57
So employ arglists, gotcha. Thanks for your help on this one, I'm more so just poking about your utilities, but not necessarily using such techniques until I'm both fully competent & confident!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Manson_NS
15
Years of Service
User Offline
Joined: 4th May 2004
Location: Denmark
Posted: 26th Nov 2013 15:26
Minor request on the lookup tables.
I am trying to rid my code of the Styx commands, which is progressing neatly, however the ini-loading in Matrix1 could use a few commands to investigate the loaded data - like getting the amount of entries in the lookup table, getting their names, sections, etc.
This would really be a nice addition, I'd love to put the Styx plugin behind me. I do of course realize that this is quite possibly beyond the original intend with these commands, but it does not seem completely off from my perspective.
IanM
Retired Moderator
17
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Nov 2013 23:46
One thing to remember is that the lookups are not ini files - yes, there are methods of loading and saving from/to ini files, but those are more for convenience than anything else. Basically, the functions you want are useful, but don't really belong to the command set itself.

So, here's how to write them in DBPro:


Here's the test file I used, culled from a 'cleanup' program I use in my plug-in test area to clean everything up prior to checking it into source control:


That was fun. I haven't written any DBPro code for quite a while, so I quite enjoyed that.

Login to post a reply

Server time is: 2019-10-17 04:28:15
Your offset time is: 2019-10-17 04:28:15