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.

Newcomers DBPro Corner / Is it possible to INC/DEC variables that are part of arrays?

Author
Message
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 23rd Jun 2004 02:37
I was wondering if it is possible to INC/DEC variables that are part of arrays.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 23rd Jun 2004 03:02
yeah with dbpro...i odnt think u can with dbc.....like:


dim number(1)


do

inc number(1)
set cursor 0,0
print number(1)

loop

cheers,
Bish

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."

You see my avatar? I made that ninja!!
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 23rd Jun 2004 20:11
You can't in DBC, but I don't know about Pro. With DBC, you have to go var(1)=var(1)-2 or something similar.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Jun 2004 20:28
I tried inc array(index) in Pro and got na error.

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Skeletor
20
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 24th Jun 2004 04:03
ya that is terrible... most of the things I would use arrays for in my games use the Dec / Inc statements!!!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 24th Jun 2004 04:10
Works fine in DBPro. Don't know why David T has a problem though. Works for everyone else!

This prints '8' which is what you would expect




Boo!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 24th Jun 2004 04:14
There is a bug where you can't INC or DEC float arrays though unless you specify the inc or dec amount. See this link

http://darkbasicpro.thegamecreators.com/?m=forum_view&t=25153&b=15


Boo!

Login to post a reply

Server time is: 2024-09-22 14:29:59
Your offset time is: 2024-09-22 14:29:59