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 / Help with arrays

Author
Message
Blazer
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 20th Feb 2003 05:20
is it possible to either:

1.) change a text array into a normal array

or 2.) add a # to a text array

I need to add #'s to my items for example:

Item$(0)="sword"
Item_no$(0)="1"

is there a way to increase Item_no$(0), I need it as a text array also. Plese help
As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Feb 2003 13:30
Use a type instead of lots of arrays, it will make your life so much easier.

type items
item_name AS STRING
item_number AS INT
etc
endtype

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 20th Feb 2003 14:11
Rich this is the DB board- not DB professional

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Feb 2003 14:14
So? Upgrade then

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 20th Feb 2003 14:27
if you require several types in a single array then simply use it as a string array



however you'll have to remember that its in string form and when you call it do so like



Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 21st Feb 2003 02:10
darkedit has types for DBC users that get converted back to arrays for actual dbc usage.

Blazer
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 21st Feb 2003 04:17
Thanks for all your help, but got another problem:

I used ravens way, now I have it so if I press spacebar the string is increased, the problem is i need a variablefor my string so its like this:

if spacekey()=1 then Item$(0,1)=str$(X+1)

were X= the # I had before I changed, and after I add that one, i need that to become the new X.

As I walk through the vally of the shadow of death, I will fear no evil.
- Psalms 23:4
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 21st Feb 2003 05:17
ROFLMAO Rich that was the greatest reply every !!! (^_^) Made me laugh and ive been away for the past 39 hours!!!!!

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2025-05-15 19:00:38
Your offset time is: 2025-05-15 19:00:38