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 / declaring variable type and setting value

Author
Message
MayoZebraHat 1979
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 29th Jun 2008 10:22
I noticed while doing some variables in a image processing function that:

imgDataEnd as integer = Get Memblock Size(1) - 4

compiles but will return nothing or 0 rather, however:

imgDataEnd as integer
imgDataEnd = Get Memblock Size(1) - 4

Works just fine.

Would this be considered a bug? What does DBPro define something as when I set a value without declaration? Is it better to declare or let DBPro handle it. I'm inclined to do so either way, but I'm very curious. It would seem rather cumbersome for the system to always be changing a variable dynamically if it changed value beyond a specific type. While I'm at it, when I declare a boolean will that boolean use one byte or does it share bytes with other booleans in the program? Sorry for all the questions but memory optimization is important to me.

Login to post a reply

Server time is: 2024-11-25 02:04:36
Your offset time is: 2024-11-25 02:04:36