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 / wierd dim glitch

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Nov 2009 01:50
run this:

dim arr, 2
print arr
end

you will see(atleast on my machine) it prints a number around 1.4 million. the variable arr isn't global when done like this. i ran into this by typing something like this:

dim arr

and it told me "Dim expects integer,integer" so i thought what if i put a variable comma a integer lol. any ideas on what is causing this? not useful but interesting.

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Nov 2009 17:32
I wonder if those are pointer values.

Enjoy your day.
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 20th Nov 2009 21:34
Hmm if those are pointers, maybe there's a way we can write to the array directly.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Nov 2009 23:00 Edited at: 20th Nov 2009 23:51
Thats what i was thinking. I might run some tests with a dll. if that is a pointer then that's the second db pointer leek i have found haha

Ran some tests. I made simple dll with a GetPointerValue() and SetPointerValue() function. It definitely points to something. Using get pointer value, the value returned is always zero(which is a good sign because i'm pretty sure db initialized there variables ) and i think(Stressing the word THINK) that the second number controls how many array ummm dang forgot the word(indexes maybe?). well how many spaces the array has, because when you get pointer value for the pointer + 4(integer size = 4) it still returns 0 when using:

dim arrptr,1

The set value works of course since we have determined that it is a real pointer. The values aren't being changed from somewhere else during execution(i ran it in a loop with it getting the value constantyl. nothing changed), but about 5-10 minutes after testing i got a message from Windows "Windows is closing the process "firefox.exe" for your safety" or something to that extent. I am not sure if they are related because it was around 10 minutes later. It might just be my old laptop

New Site! Check it out \/

Login to post a reply

Server time is: 2024-03-29 04:58:28
Your offset time is: 2024-03-29 04:58:28