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.

DarkBASIC Professional Discussion / maximum string length?

Author
Message
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 18th Feb 2004 00:20
is there one...i had a program that used strings and it broke when i added some long ones

Proteus 1935
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 18th Feb 2004 01:05
probably 256 chars...

Currently coding: VideoCapture Plug-in (cameras)
Recent coding: Momentum concervative collision response
Proteus
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 18th Feb 2004 01:18
YOU'RE SERIOUS!!!!!!!!!!!????????????????!!!!!!!!!!!!!!!!!

sorry for the caps but im verrry mad. im gonna have to redo my whole program but thanks for responding.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Feb 2004 01:28
No way is it 256 characters - that was the limit on DBC.

I am not aware of a limit to string length, except that it should be limited only by available memory - I'm not totally sure if this is true.

Use the following code to see ... if it crashes then use the last number it displayed.



I know that it's at least 100,000 chars - I got that far before I got bored

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Doremar
21
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 18th Feb 2004 01:28
256 is a pretty frequent limitation in programming languages, but it doesn't appear to be the case in DBP. I just did a quick test with a 2000 character string and it didn't seem to have any problems running...

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Feb 2004 01:41
I created some large strings like IanM but you soon get to a point where proggy becomes unresponsive but you are talking many hundreds of thousands of characters.

@Doug - how many characters are we talking here? Why do you need long strings. Surely must be a better way of doing things.

Boo!
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 18th Feb 2004 02:05
i checked my booklet at aparenlty the string length max is 255.

im try to load a side scrooling shooter with enemies and all off a .txt doc. its the easiest way i cud think of. if a want an enemy or something i just gotta add a letter

Ralen
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 18th Feb 2004 02:32
Doug,

Can you splain what you are trying to do a little bit better?

Ralen
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Feb 2004 02:36
What 'little booklet'? Are you talking about a DB manual? Are you defintely using DBPro, which has no string limit, or DB classic which apparantly has a 255 string limit.

I'm confused.

Boo!
DrakeX
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 18th Feb 2004 04:52
DBP has unlimited length strings, like everyone else said, but it doesn't seem to like them very much. i had problems with TEXT and anything longer than about 350 or 400 characters.

doug - ever hear of the file access commands?

athlon xp 2000+ | radeon 9500 pro 128mb | 512MB DDR | winXP pro | DBP 5.1b | B3D 1.85 | VC++ 6
predicted DBP P6 release date: March 28, 2004
DBP has made me bitter.
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 18th Feb 2004 05:40
im talking about the small booklet called "user manual" not the thick one. it says strings can be up to 255 char. im got the book with pro.

drake x, what do you mean "file access"? I know how to read a .txt file with open to read and read string but they seem to stop working after the strings a certain length.

ralen,what i mean is that if a certain character is found in a .txt, the game will load an object in 3d in an equivelent spot. i could do the same thing with data statments but then i gotta put commas between everything me not like commas!!

DrakeX
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 18th Feb 2004 05:59
i do believe READ STRING has a limit of 255 characters (probably something they forgot to change.. should be a bug). however that booklet is wrong in saying DBP has a limit of 255 characters in a string.

you can make a read string function using the other file access commands. or, you could skip strings altogether and just use numbers like with READ/WRITE LONG.



there. you can now read strings longer than 255 characters from a file.

however let me guess -- you're reading a string, then parsing the string (going thru it character by character and decoding it) to make the level, right? if you use READ BYTE instead, you can skip the whole parsing thing altoghether.



THAT, my friend, is file access.

athlon xp 2000+ | radeon 9500 pro 128mb | 512MB DDR | winXP pro | DBP 5.1b | B3D 1.85 | VC++ 6
predicted DBP P6 release date: March 28, 2004
DBP has made me bitter.
Great Knight
22
Years of Service
User Offline
Joined: 25th Feb 2003
Location:
Posted: 18th Feb 2004 09:48


lol. Do this in DBP till it can't go up any more. It goes up very big and that shows that a string can hold over 1,000,000 charaters.

AMD Atherlon 2400+ XP, 380 DDr memeory, ATI Radeon 9000 64 DDR, Windos XP home edition.
-----------------------And a Katana.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Feb 2004 10:27
filename limits on FAT32 systems was 255 characters long. ntfs file system has a much larger size limit, no idea what it is though. Its a common limit, and it should prevent anything from getting done.

I just found something interesting. Run this bit of code, and see if it gradually slows down for you too.



"eureka" - Archimedes
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th Feb 2004 11:22 Edited at: 18th Feb 2004 11:22
Not really surprising - your adding a million spaces at a time, for which memory needs to be allocated for each addition... Due to the poor memory managment system, its probably using the swap space...


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me
TheCyborg
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 18th Feb 2004 15:51
I didn't bother reading all of your posts, but i expanded a little on IanM's code to count max lenght...



I'm past 7.5 million chars and still counting...

Member of Tjald - Targeted Joint Addicted Liberation Diplomacy

I am (currently) 45% addicted to Counter-Strike. What about you?
TheCyborg
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 18th Feb 2004 15:59 Edited at: 18th Feb 2004 16:28
hmm... still counting... 13.5 million Chars

EDIT: I stoped it at 22 million chars.

Member of Tjald - Targeted Joint Addicted Liberation Diplomacy

I am (currently) 45% addicted to Counter-Strike. What about you?
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 18th Feb 2004 18:55
wow...thank for the help

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 18th Feb 2004 21:32
Quote: "im talking about the small booklet called "user manual" not the thick one. it says strings can be up to 255 char. im got the book with pro."


It is an error in the booklet. The limit for DarkBASIC Classic was indeed 256 chars, presumably so character indicies could be stored in a single byte, however for DBP it is unlimited.


BlueGUI-Windows UI Plugin

Login to post a reply

Server time is: 2025-06-03 17:57:43
Your offset time is: 2025-06-03 17:57:43