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 / problem with ints.. help would be appreciated

Author
Message
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 28th Feb 2004 09:48 Edited at: 28th Feb 2004 09:51
hi guys,
im making a fairly simple maze game, and im making a 2d editor for it. I ran into a problem where the program just will NOT write a number to the screen.. its EXTREMELY annoying, as i dont see anything wrong with it.

the problem is on the second last line of the second function.

pleas help me,
thanks
Casper

EDIT:
i should probably mention that, although it writes a "0" to the screen, it refuses to write anything BUT a "0" even when the variable is a 1 or a 100 or whatever.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 28th Feb 2004 15:18
near the start of your program:
instead of:

currenttile=100

put

Global currenttile=100

that should work if you are using dbpro or the darkedit editor for dbc, otherwise you will need to store the currenttile info in an array.

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Feb 2004 18:44
or make your function

function writetext$(currenttile)

and the function call would be

writetext$(currenttile)

so you tell the function it will get a value called currenttile and that it will be called currenttile inside the function, remeber that if you alter the value of currenttile inside the function that it will make no difference to the value of currenttile in the main program, cheers.

Mentor.

1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, 2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 28th Feb 2004 22:59
i think that variables called in functions equal 0 unless the variable is defined inside the function
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 29th Feb 2004 06:06
ah great thanks guys it works

Login to post a reply

Server time is: 2024-11-26 07:30:35
Your offset time is: 2024-11-26 07:30:35