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 / using types as indices in a type array

Author
Message
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 25th Mar 2004 21:54
hey all,
ok, well, i'm trying to do what i said in the title. the code is thus






and i declared it above with





i can't see what's wrong, unless you can't use types as array indices? thx all.

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 25th Mar 2004 22:03
DBC doesnt support types

Currently thinking of a new company name
Sticking to a project idea for once
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 26th Mar 2004 05:41
Unless.....you're using DarkEdit? I never figured out how to use DarkEdit's TYPE commands.

Crazy Donut Productions
Current Project: KillZone
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 26th Mar 2004 07:07
yep, darkedit. ah, types are such beautiful things, lol.

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
M Gaming
21
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Everywhere
Posted: 26th Mar 2004 07:12
Except in DBC the types cannot be substituted for a lot of things.

M Gaming - Soon to release several games
Sometimes, you have to keep doing something...even when it's boring.
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 26th Mar 2004 08:04
yea, so it would seem. probably has something to do with the fact that the "types" are actually arrays. oh well, it's not necessary that I use types.

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 31st Mar 2004 07:55
I have done that before, there are 2 problems....

1 - leave space before and after the areas where you use types.
Sometimes the preprocessor has trouble determining where to replace your types with the correct code....

2 - DBC does not like it if you use the same array as an index to the same array ....
example:
dim A(10) as integer
A(A(8))=1 ......DB does not like this context

A way to debug preprocessor stuff in DE is to perform the following very dangerous operation:

1 - Save your code
When using DE preprocessor options,
you should use a special name like
MyFileDE.dba
2 - Save as another name...
MyFileDB.dba
3 - Select the compile options
but do not let it finish .....
4 - Select the replace source
5 - Save as MyFileDB.dba .... just to be sure
6 - recompile and see what errors are present....
also, this will show how DE replaces code in your project.

Now for the fun part:
remember to fix errors in the main source file MyFileDE.dba
and not MyFileDB.dba. And if you wish to include this file
into other projects, you would include MyFileDB.dba instead of
MyFileDE.dba because the preprocessor only works on source files and not included files............. whew

internet gaming group
current project http://home.comcast.net/~norman.perry/Archon.html

Login to post a reply

Server time is: 2025-05-23 03:34:07
Your offset time is: 2025-05-23 03:34:07