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 / Small .dll request - larger numbers than an integer to string

Author
Message
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 20th Jan 2005 11:51
The str$ command doesn't work with values larger than an integer can store. I've tried making my own c++ .dll to fix this. Unfortunatly, I lost the help cd for it, so I don't know what the error it's returning means. So, could someone either make a .dll to do this or tell me what 'c:\microsoft visual studio\vc98\include\stdlib.h(37) : warning C4518: 'extern ' : storage-class or type specifier(s) unexpected here; ignored' in reference to 'extern "C" {' means?

Thanks.

Cheese!
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 20th Jan 2005 23:54
can you post your source code?

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 21st Jan 2005 05:01
aparently the error is being caused by something that came before the extern "C"...

AphoticVM status: 80% AphoticBasic status: 10%
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 21st Jan 2005 18:07
Why not just do it in DBP? Here is an example of how to make a dword of any size allowed into a string. Just follow this and you can make one for double integers as well. Though it will all have to be hard coded as DBP doesn't like double integer arrays.



Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 21st Jan 2005 18:45
Wouldn't that produce drift? DBPro, at least, doesn't seem to handle decimals well, although I think it may be a processor thing. I don't know. Heard something somewhere.

As to the source code, it's simply the third-party .dll example code with the stuff recommended for strings and the reverse string command included, which wanted more and more headers. If you want, I can include a zip.

Thanks everybody.

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 21st Jan 2005 18:55 Edited at: 21st Jan 2005 19:13
Oh I didn't know you wanted it to work with floats as well. You can use something like this for positive values up to double integer size. Yeah you will need a plugin for floats I bet.



[edit] This should work for every non float value from -9223372036854775808 to 9223372036854775807 including 0. I'll have to check on floats later.



Just change the value of "value" to whatever and run it. I have several I was testing with commenting them out and uncommenting others.

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 22nd Jan 2005 08:48
can there be too bgi of a string i know i was testign somehtign and caused my app to freeze by entering a big huge sentence

come to my forums http://hck83.darktech.info/forum/ formerly: 404 name not found
"others understand me but i dont understand my own thoughts"
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 22nd Jan 2005 11:50
Well it's what ... 1 byte per character. So if it is long enough to use up your memory then it could. I don't know of any DBP string limits though I sure there are limits.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 25th Jan 2005 05:47
Thanks, Thought. I'll give those a try.

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 25th Jan 2005 08:28
Hope you get it working. I'm still researching floats.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 26th Jan 2005 04:32
The reason I mentioned floats was because I thought you were using them. But one for floats would probably be helpfull to.

It works. (At least, the second one does)

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 26th Jan 2005 05:02
Yeah the first one was just an attempt to show how to do it (positive values only). The scond code is full range. It seems floats may be alot harder. No promises if I can do it, but I'll keep looking into it.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 26th Jan 2005 05:52 Edited at: 26th Jan 2005 05:52
It appears functions don't accept values greater than integer.

I turned it into a function for easier access, globalled all the variables and put TS in front of them. Then, I simply set TSvalue before calling the function. It works perfectly. And, I discovered another DBPro bug.

Double integers don't seem to work with arrays. Could someone try the source code I included?

Cheese!
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 26th Jan 2005 06:00
Updated source test code, for DWORD(Working) and float(Treated as integer).

Cheese!
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 5th Feb 2005 02:49
Um, can someone please test it? All you have to check is that all the lines are the same, except for the floats, which should be 1/10th of the number and include one decimal place. I'm not asking for the moon.

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 5th Feb 2005 14:35 Edited at: 5th Feb 2005 14:36
This is what I get just running the code with no changes. Nothing looks the same to me. And looks like a whole bunch of something else going on too.

[edit] The first and last numbers of each match, but what is all that in the middle (too lazy to read code)?

Attachments

Login to view attachments
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 7th Feb 2005 16:13 Edited at: 7th Feb 2005 16:14
First twenty rows of four are a typed array; Integer, Double Integer(Not working on yours, either), Float(Same), and DWORD. The next row of two are both variables; one's typed as Integer, the other as Double Integer. Both are working. The next row of two is a single variable with two types; again, Integer and Double Integer. Both are working. The last column of five is a single array dim'd as a Double Integer; it is not working.

Basically, all it does is rnd(50000) and assigns the same number to each row. So all numbers on each row should match (Except the third collumn in the first twenty rows, which is divided by ten to test Float functionality) and each number should be between 0-50000.

Exact same results I got. Now, go request they fix this in the bug thread too. If you want it fixed, that is.

And thanks.

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Feb 2005 19:59 Edited at: 7th Feb 2005 20:13
Mine works with every type but floats from all ranges. Here it is converted to a function. I still haven't messed with floats yet. As it turns out I have found several errors (or not supported features / design flaws) in DBP. Arrays only seem to be working properly when they are cast as anything smaller than integers, floats, or strings. For example dword and double integer type arrays give you wierd results. And the rnd command only works up to like 2147483647



[edit] And I don't know If you noticed yet but I hardly ever use UDT's as I had some bad experiences with them throwing errors.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 9th Feb 2005 03:39
Thanks.

I havn't had any weird UDT problems yet.

Cheese!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 9th Feb 2005 03:45 Edited at: 9th Feb 2005 04:58
Yeah I haven't tried them since early DBP releases. I heard they are alot better but why change now I can program just fine without them.

[edit]
If you still need double floats, it can probably be done using a bit shift dividing the float in 2 seperate 4byte dwords (one of the upper bits and one of the lower bits) and then putting them back together on the other end. It may be a few days before I can look at this. Regular floats should be easy though.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 9th Feb 2005 13:23
I'm also messing around with integer operations on a string.

Cheese!
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 23rd Feb 2005 02:50
Can't seem to get decimal multiplication on a string working. Any and all help would be appreciated.

Cheese!

Login to post a reply

Server time is: 2024-04-25 07:43:30
Your offset time is: 2024-04-25 07:43:30