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
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Aug 2010 00:41
Quote: "Make Rng KR has 60 for a relative speed"

Huh? Can you provide a little more detail/link/code?
Or is it an example I've posted somewhere?

There's certainly nothing in the help for that command that says anything about 'relative speed'.

@Syncaidius,
I'll take a deeper look into that. It's definitely not right though.

@sladeiw,
I understand what you mean, but the problem is that the current functionality is wrong for integer values IMO. It basically does something that is not expected by the majority of people.

Conceptually, for integers, the wrap function should be treated as inclusive of the end points, i.e. if you have a value of 100 and an upper limit of 100 and a lower limit of 0, then adding one to your value should take you to 0, not 1 as it does now.

For floating point values, the existing functionality will not change. Using the range [0, 100], then adding 0.01 to 100.0 should take you to 0.01.

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 16th Aug 2010 02:44
Quote: "It basically does something that is not expected by the majority of people."


Yea I know I think I am just dreading fixing & testing them all lol.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Aug 2010 15:50
Quote: "There's certainly nothing in the help for that command that says anything about 'relative speed'."


Actually Ian, there is. It's in the description and I too was wondering what it was:

Quote: "Type = Shuffle Output / kreutzer1986
Cycle size = Unknown
Memory usage = 5472 bytes
Relative speed = 60"




Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Aug 2010 22:45 Edited at: 16th Aug 2010 22:46
Just in case IanM missed it, here's an image taken from his link.

Attachments

Login to view attachments
leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 17th Aug 2010 15:37 Edited at: 17th Aug 2010 15:39
if i download the plug in from here
Quote: "We're now up to 33 plug-ins in this pack - latest release info can be found HERE (Release 20100726)"
is this a complete commands or is this a patch, if so a patch. do i have to download every single plug in from there orignal link.

i did download and none of the commands are highlight in blue. what am i doing wrong. keep in mind that i bearly learning how to use darkbasicpro.


IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Aug 2010 15:35
The zip file is a full release every time. I try not to deal with patches.

Assuming you are using the new editor, then every time you install a new release, you need to rebuild the editor's cached keyword list: Tools->Rebuild Keywords

@Scraggle/GG,
Whoops.
That's an indication of the average speed of the generator. Higher numbers are better. But remember it's an average - some of the generators will generate a large set of random values internally, taking quite a while initially, but then being lightning quick for the rest of the list until it has to generate a new list again.

Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 19th Aug 2010 07:51
I'm finally at a stage of understanding DarkBASIC Pro, where I can now make sense of this Matrix1 Utilities pack. I must say, this is friggin' awesome! I don't know where to begin! So many new functions! So many cool ideas and handy tricks!

Brain explode!

A big thank you goes out to IanM and all involved in the creation of this package. Fantastic stuff.
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 21st Aug 2010 05:32 Edited at: 21st Aug 2010 06:40
@IanM:

Using your SHA512 for password encryption in my game and I want my game and web forums to use the same user database. On the web page side I am using a perl plugin for SHA encryption (http://search.cpan.org/dist/Digest-SHA/lib/Digest/SHA.pm) but I get different results than your plugin. I am not really experienced in SHA encryption but do I need an algorithm or something to get the same results as your plugin?

The Perl method I am using is Digest::SHA->sha512_hex(pwd$), and the strings look like the follow the same format, but are clearly different.

- Dustin

Edit: Found a way for Perl to call functions in external DLLs, but I would need the definition? as defined in the DLL, such as DWORD WINAPI GetTempPathA( DWORD nBufferLength, LPSTR lpBuffer );. Then I could just get my webpage to use your DLL for encryption as well.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Aug 2010 17:25
It's not possible for you to call the DLL as a stand-alone DLL - because the function you need (SHA512_memory) returns a string, it allocates the memory for that string from the DBPro runtime, which must be present.

Can you post examples of how you are using the plug-in, an example of your perl code, maybe the hex strings you get from each one, and I'll investigate what the difference is. It may be something as simple as byte ordering, or it may be something a lot more complex.

GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 22nd Aug 2010 05:51 Edited at: 22nd Aug 2010 05:54
Your SHA512 for "bob" is:
0416a26ba554334286b1954918ecad7ba6c33575b49df915ff3367b5cef7ecd93b1f0b436636667b27b363011543971f1c81c3151d5ef72733501c1ff33c34af
Perl's is:
06a8e2a227fedfba873e7d7b603d989f8272eca5c09a438a0c6aec3d85b506f6d73013dc2989bc3629ecb078f696e00a0bd532f986ec49645a571f6a9a0dd4ac

I know, that is one halluva strong password, but I wanted to use something simple that wasn't my own password. ;P

I wrote a script for you:


And in case you don't have a perl based webserver lying around, that script can be found at http://www.klankamakazee.com/cgi-bin/SHA.cgi

Edit: I am assuming you want to look at the SHA512_hex since it follows the same type of pattern and length as your own results

Steele
20
Years of Service
User Offline
Joined: 25th Oct 2003
Location: Somewhere over the rainbow
Posted: 22nd Aug 2010 18:49
Hi Ian,

Thanks for the explanation and thanks to Green Gandalf and Scraggle for backing me up with information. Weekends are about the only time I am able to get to work on the desktop computer these days so I wasn't able to respond before now.

Since it is an indicator of average speed and higher numbers are better, would you clarify what it means? It wouldn't be the number of milliseconds it takes to run obviously.

Thanks again,

Steele

Maybe it's just a bunch of stuff that happens. -- Homer Simpson
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Aug 2010 15:30
The numbers themselves don't mean anything except as an indicator of relative speed between the different random number generators.

Think of them in terms of the number of times they can be called in a certain amount of time, on a certain processor, with certain speed of memory and with certain other processes running - basically, it'll be different for everyone, so nailing down exactly what they mean is meaningless.

@GIDustin,
I'll look at that over the next few days.

Neotron
13
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 27th Aug 2010 16:21
Hi ianm

is there any command for getting the frame of the limb
like object frame(obj)
to object limb frame(obj,limb)

if it is not in your dll then plz tell me if there is any where.

ALLAH IS THE GREATEST
May he forgive me
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Aug 2010 23:10
No, because I haven't touched animation so far, knowing so little about it. Your best bet would be to take a look at the Advanced Animation plug-in

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Neco
15
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 7th Sep 2010 22:08
IanM,
I cannot for the life of me recall where I posted about the problem I was having, maybe it was in this thread and got burried..

However, I was able to isolate it down to a single DLL, and I'm not sure if I ever provided you with that information..

Basically, something is hosing my install and when it comes time to compile, even if there is an error, there will be no real information in the compiler log - and specifically on a syntax error, that line of code that is in error will not be highlighted by the editor.

I managed to isolate this (through trial and error deletion) to Matrix1Util_16.DLL - all other DLL's are present but when this one is introduced, it causes this problem, and when it is taken away the problem resolves.

I tried it with it being the only DLL from your set also, and the behavior was the same..


So, apologies if I actually did provide that info before, but I thought I would mention it, as I was playing around with someones example code and realized I needed to install some stuff to get it to run, then came across this old problem again.

If I didn't, perhaps maybe it'll give you some ideas on what might be wrong in that particular DLL.. It would be helpful if anyone else could try and reproduce this problem, especially if you've never used or installed this specific DLL.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Sep 2010 22:33
Do you have the VC++ runtime redistibutables installed on your system? (link at the bottom of the first post).

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Neco
15
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 7th Sep 2010 22:51
Yup, I've run some of the DLL examples successfully

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Sep 2010 00:12
The command "log2" appears to be broken

[b]
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Sep 2010 16:51
Quote: "The command "log2" appears to be broken"


I was going to say "No it isn't" and wrote this simple demo to demonstrate. Then I ran it.

Is that the problem you meant?

Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Sep 2010 23:46
I get the message:
Quote: "
---------------------------
Error
---------------------------
Could not find function 'Log2_double' in 7:Matrix1Util_07.dll
---------------------------
OK
---------------------------
"


[b]
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Sep 2010 00:57
It's caused by a typo I introduced somewhere along the line - if you have a resource editor, then you can fix it temporarily by changing the name of the function called to 'log2_double' (the first letter has a different case).

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Sep 2010 01:12
That fix worked fine

[b]
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 12th Sep 2010 10:41
I installed Matrix1Utils
all commands showed up

it would compile but if I used the compile and run
that would not work

I removed the ini's and the dll's and then every thing worked fine

I've got a few addon's and the main ini for dbp is tweaked
becouse of anther addon I found in the forums some time ago

I've got nearly every thing DBP is selling

so there must be a bug still left in it

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Sep 2010 14:21
Quote: "that would not work"

In what way does it 'not work'?
Is it simply that you don't have the C++ runtime installed on your system? (See the bottom of the very first post).

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 12th Sep 2010 15:52
I can't compile and run the program using f5 key
the f4 key works

when I took them out every thing ran like I remember it

the ones I have on my system are newer than
the one posted here

If a thought is Just a thought ~ so whats the main thought ?
Neco
15
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 12th Sep 2010 23:20 Edited at: 12th Sep 2010 23:22
Heh..

So apparently I did not have the latest version of the DBPro editor.. I found U75 and got it and now the editor is updated.

The _16.dll doesn't cause any problems..

except for this, when trying out a command. It looks like a conflict with the Styx DLL

Quote: "
Duplicate TRIM$ in StyxCore.dll and Matrix1Util_16.dll!
Command in 'StyxCore.dll' command-table unrecognised (TRIM$[%SSS%TrimStr)
"


Not sure why that is popping up at all since all I did was type this to see if it worked how I thought and I understood the syntax



gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 00:09
it seems there is conflict between the programs
they could use the same memory space or code in DBP
and even though they might not be needed at the same time
the both want to be used at the same time ;oP

I've got a basic idea of programing so that's the only thing I can think off

I'll put the ini's back in and the dll's and yank StyxCore.dll
and see if that solves the problem

also every once in a wile I find a dark basic pro file some one made
that will not compile .. I get no error codes just it looks like
it's going to start then nothing

If a thought is Just a thought ~ so whats the main thought ?
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 13th Sep 2010 00:15
Ian's DLL has a "trim$" command and so does styx, You will get that error every time you compile but just ignore it as it doesnt matter. It is using Ian's version anyway.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 00:23
the old name conflict ... dang...

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 03:29
ok it is Styx file set ..
I took them all out and it would compile and
now it says "Compilation Successful"

any chance that one command name could be changed ?

I know it once it's changed in the dll
it would have to be changed in the documentation


umm in the Matrix1Util_28 Tutorial folder

since there is a "EchoClient04"
should there not be "EchoServer04" ?

I now wondering how many other dll's are confliction with each other commands ....

or if there is bad code in each dll that is causing problems
when there run or mix together

If a thought is Just a thought ~ so whats the main thought ?
Neco
15
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 13th Sep 2010 03:53
Ah.. I had assumed it wasn't compiling properly..

personally, I will likely get through it and everything, and learn to ignore it.. but I hope this and other similar issues can be resolved in the future.

It shouldn't produce warnings under ideal circumstances. But I know its impossible to test for everything as well.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 04:24
f4 compile with out running worked fine
f5 would not run after compiling and it would not show the notice
that it had completed the compiling process

I know it's highly likely to end up with the name's used in other
programs , and in this case that was the case

I will defiantly have to remember this if I ever make an add on
for DBP

and the only addition I want to do is the the code for
breaking glass in any direction and to show the realistic results
based on force and size of object hitting it

the other part to that would be damage to an object
either denting for hole being ripped into it based
on the force of the object being used on it

that;s the only thing missing from DBP

every thing else is there

I also herd from the persons who programed worldsapartonline.net
that when the program gets soo big that it has
ran out of stack space which could limit me on the programs I got
in mind

If a thought is Just a thought ~ so whats the main thought ?
GIDustin
15
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 13th Sep 2010 04:31
Quote: "I also herd from the persons who programed worldsapartonline.net
that when the program gets soo big that it has
ran out of stack space which could limit me on the programs I got
in mind"


I herd he's a pretty smart guy. However, if you program right and keep the stack size in mind while you go you can easily make huge MMOs without worrying about hitting that limit. It all boils down to how efficiently you code.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 08:13
so what could have he dun ware it has that problem ?

the game he has I know some one else made
something nearly identical but it was not online version

there was a lot of code in that one ....

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Sep 2010 20:35 Edited at: 13th Sep 2010 20:36
Quote: "since there is a "EchoClient04"
should there not be "EchoServer04" ?"

Read the accompanying tutorial doc - it all makes sense.

EchoClient01 is covered in tutorial 1.
EchoServer01 is covered in tutorial 2.
EchoServer02 & EchoClient02 are covered in tutorial 3 - EchoClient02 contains no new commands, so there isn't a code listing in the document.
EchoClient03 is covered in tutorial 4.
EchoServer03 is covered in tutorial 5.
EchoClient04 is covered in tutorial 6 (except there's a typo and the code is named incorrectly - I shall correct that and re-upload it).

Quote: "I now wondering how many other dll's are confliction with each other commands .... "

None apart from STYX that I'm aware of. You can tell simply by compiling a program that has just one command from each plug-in, and it'll tell you all conflicts with those plug-ins.

Quote: "that when the program gets soo big that it has
ran out of stack space which could limit me on the programs I got
in mind"

Not technically true - the size of the program doesn't affect stack space usage, it's the code that you write and the way you write it that does that. For example, it's easy to write a two line program in DBPro that would blow the stack:


Generally, as long as you don't do something silly (as per the above code), or use recursive routines with no care, then you'll be fine as far as stack usage is concerned.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet

Attachments

Login to view attachments
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Sep 2010 23:09
IanM thanks for the info

ahh ok typo's I understand that


so basic gosub's should not need to take
up stack space permanently like the other version of it ?

I was going stick more with functions in my loops
too bad bytes can't bee freed other than restarting the program

my goal was to keep all program streamed lined as possible
with having all the plugins for DBP that I can
it would cut down on extra's ware possible

the only extra code function I am still thinking out
would be damage to an object as taking something apart
to give the flavor of damage being dun to it

right now there is no dll command set for that but there
are function that I will create using the cull commands
that I know about now

perhaps one day damage functions I create can be turned
into dll's to speed them up and to take up less space
in the program and freeing up memory such as stack space

I've been playing with 2 idea's about how to show a tire
is going flat or getting filled with air and the damage to
and object weather it be a window anther part of something

I got the basics understood for both now the rest is
something I have to try and understand

If a thought is Just a thought ~ so whats the main thought ?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Sep 2010 15:06
Quote: "I got the basics understood for both now"

Actually, I would say that you haven't - my example was to show a method of filling the stack, not to provide a reason to avoid GOSUB and use FUNCTIONs instead, or vice versa.

Both commands will use the stack to store the program return address. Both will free that usage when control returns to the calling point.

In addition functions will push their parameters onto the stack, and also store local variables on the stack too.

And that's not a reason to NOT use functions either.

Anyway, if you want to continue discussion of this (which is off-topic for this thread), then feel free to open a new thread in the DBPro forum and I'll happily trade posts about the inner workings of DBPro with you and anyone else who wants to contribute to the discussion.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Sep 2010 16:58
I understand .. it's still a thought to keep in mind that most people like me were not aware of

you figure you build a program and your basically set
clearly more than whats shown

If a thought is Just a thought ~ so whats the main thought ?
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 16th Sep 2010 22:45
I don't know if anyone else has come across this before but I'm using the word splitting commands and find myself needing to get the position in the original string of each word. At the moment I'm counting each word size+1 to get required position, but a command like `split word position` would be really handy.

Also, just out of curiosity why did you not `replace` the dbpro left$ right$ lower$ upper$ commands with yours like with your rgb and mid$ commands? Is there some reason you gave them different names?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Sep 2010 15:39
Quote: "split word position"

Shouldn't be too hard to implement.

Quote: "why did you not `replace` the dbpro ... like with your rgb and mid$ commands?"

I haven't replaced any commands, I've only supplemented the existing commands. I've added new versions of MID$ and RGB that accept different numbers of arguments, so that when you use the extra arguments with those commands, my versions get called instead.

I could replace existing commands if I wanted to - I have that ability if I choose to use it, but I choose not to to avoid complications. For example, if you have a crash caused by LEFT$, would I need to debug my version or the official version?

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 17th Sep 2010 16:08
Quote: "I choose not to to avoid complications"

That answers my question then

I didn't realize if you use the original number of arguments that it still uses the original version of the command.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2010 12:00
Quote: "For example, if you have a crash caused by LEFT$, would I need to debug my version or the official version?"


Doesn't that argument apply to the RGB function?
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 18th Sep 2010 12:28 Edited at: 18th Sep 2010 12:29
Quote: "Doesn't that argument apply to the RGB function? "


If I understand correctly, if you use the normal rgb(r,g,b) command it uses the original dbpro version, if you use rgb(a,r,g,b) then it uses his.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2010 01:51
That's my understanding too. But if things go wrong why assume one rather than the other?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 19th Sep 2010 07:20
@ IanM,

Considering using your Lookup plugin (MatrixUtil31) but also looking at your old Matrix1Data plugin.

I really need to be able to use both a Section and a Key (as well as loading in and saving out as .ini).

Does the Lookup plugin cope with Sections as well as keys? If yes, how?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Sep 2010 17:01
The readme file is available alongside the plug-in itself. That plug-in uses the same model as INI files do.

It also allows automatic (and hidden) conversion between strings and numbers. So you can set a string, read it back as an integer or a float, and vice versa.

The reason that I wrote the lookup plug-in was to remove that automatic and hidden conversion (avoiding the 'why is this so slow?' type questions), to allow me to add methods for iterating through a collection of data, and to remove the INI file 'model' from the plug-in (Technically, I could write a (very) basic XML module for the newer plug-in, which would be difficult for the data plug-in).

You can still use the section/key model for the lookup plug-in - in fact it supports it very simply by allowing the section and key to be combined into a single value, with a forward slash as a separator.

@GG,
Remember that when I wrote all of those commands, I didn't have any access to the DBPro source code.

My thinking was sort-of like this:
If something crashes and I've attempted to patch into the official stuff then is it my code that crashed, Lee's code, or even the patching code that failed?
If the code that crashes uses one of mine, then with example code I can tell that it's one of mine (eg RGB with 4 parameters), then I know that it's my problem, not Lee's.

Now that it's all my problem ( ), I might rethink that a little (as there are various places that I'm now patching into to provide functionality), but even so, it still might make it easier for me to keep everything separate.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 19th Sep 2010 22:05
@ IanM,

Think I follow that - thanks for getting back so quickly.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Sep 2010 21:43
Quote: "Now that it's all my problem ( ), I might rethink that a little (as there are various places that I'm now patching into to provide functionality), but even so, it still might make it easier for me to keep everything separate."


That sounds like good idea - and it'll keep sceptics like me quiet as well.
Omen
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 28th Sep 2010 06:35
@IanM,

With all the new array functions in 29, it seems like we're very close to having UDT array introspection - but I just can't quite get it right. I'm trying all kinds of approaches, but none are working - so I was wondering if there was A Better Way.

I have text files of name/value pairs like this, with the records in no particular order (I'm calling each line a "record"):

name=Darrel
health=100

...and I have a UDT that looks like this:

type playerType
name as string
health as float
endtype

...what I'd like to be able to do is to assign the value of the pair to the correct array element based on the key name. So, let's say I load a single record and I have the key in key$ and the value in fltValue.

What I'm looking for is something like this:

Get Array Field Number(Array(),key$)

This would return the field number of the UDT where the field name matches the key$. Which would allow this:

Set Array Field String(Array(index),number,value$)
Set Array Field Float(Array(index),number,fltValue)
...etc

The field type can already be returned by Get Array Field Type(), so that could be used to determine which function to called - but that won't work until I can find a way to determine which field is the correct field number

To save a single array index (player(5) for example), I'd need a way get the field name by the field by field number. Say something like this:

Get Array Field Name(Array(),Number)

(Note: Load/Save Array from/to Datafile only seems to be able to load or save the entire array - but what I want to do is just load or save a single record from a file)

...but maybe I'm missing something?

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 2nd Oct 2010 01:15 Edited at: 2nd Oct 2010 01:21
I was optimising some code and replaced some asc(mid$()) commands with mid ascii() and suddenly the code stopped working. After a bit of testing I found this: (Gets interesting after ascii code 127)



Edit: To save having to actually run the code, characters with ascii values above 127 will return negative with mid ascii().

Login to post a reply

Server time is: 2024-03-29 04:57:27
Your offset time is: 2024-03-29 04:57:27