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 Discussion / too many strings

Author
Message
helpme
19
Years of Service
User Offline
Joined: 28th Jan 2006
Location:
Posted: 3rd Feb 2006 01:52
I want to make an array of strings from a word list. When it gets to word 1998, it says that there are too many strings. Is there another way to store all these strings? (besides in a file)
!!!
19
Years of Service
User Offline
Joined: 29th Jan 2006
Location:
Posted: 3rd Feb 2006 04:22
memblocks. store strings in memblocks.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Feb 2006 05:24
You can use "data" statements to store strings within code.



Are you loading from a file already? Post your code in code snips so I can see what your code is doing to get the error.

Do it like this:
[ code ]
Your code here.
[ /code ]

If you remove the spaces between the brackets we see this:



helpme
19
Years of Service
User Offline
Joined: 28th Jan 2006
Location:
Posted: 4th Feb 2006 01:32
first of all, I can't use memblocks cuz i don't have the enhancement pack.

what I actually did was take a word list text file and made a Java program to convert each line to
. I pasted the output code into DarkBasic. It works until it gets to 1998 and then it says
Quote: "Compiler Error. Too many immediate integers."


Thanks Grog for suggesting Data statements, but i don't know how to make an array using Data statements.
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 4th Feb 2006 07:20
hmm , didnt even know that was an error. anyway you would do this

theWords:
data "word1","word2",....

and then when you want the data

restore theWords
read myvar,... (other vars)

helpme
19
Years of Service
User Offline
Joined: 28th Jan 2006
Location:
Posted: 4th Feb 2006 21:19
Okay, I tried making the words into Data and now I got
Quote: "Compiler Error. Too many data items."
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Feb 2006 23:06
Wow. I think you're just going to have to leave them in a separate file and just load that file. Why did you want to avoid using a file?


helpme
19
Years of Service
User Offline
Joined: 28th Jan 2006
Location:
Posted: 4th Feb 2006 23:39
okay ill do that. since the game is 2d and without any pictures, i kind of wanted to just have a single exe file, but i guess i can't do that .
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Feb 2006 23:51
In Classic when you compile with "Make Final" (in DarkEdit) or "Build Final" (in the default editor) all external files are automatically added to the .exe... so you will have a single file.


helpme
19
Years of Service
User Offline
Joined: 28th Jan 2006
Location:
Posted: 5th Feb 2006 01:19
oops, i didn't realize that. it's a pretty cool feature.

thank you for your help.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 5th Feb 2006 05:10
Np.


Login to post a reply

Server time is: 2025-05-23 10:40:07
Your offset time is: 2025-05-23 10:40:07