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 / Function and Image question

Author
Message
Stygian
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location:
Posted: 6th Feb 2010 11:31 Edited at: 6th Feb 2010 11:41
I am currently attempting to implement a function that I can call on to display an image.

Here is my code



I am under the impression that one cannot use any information within a function that is not an array, but that all that I really understand about what you can access globally.

Am I using a command that works differently in a function than outside? Because, this code worked as intended while this was simply a subroutine. Thanks in advance.
NightX
15
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 6th Feb 2010 13:15 Edited at: 6th Feb 2010 13:19
An array is global when Created, if you wanted to make a variable like a e.g. String or a Float you would have to put the command Global before it like so -


This can now be seen through out your WHOLE program.

Here is an example.


Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 11th Feb 2010 17:54 Edited at: 11th Feb 2010 17:57
What is the problem you are having?

Your code runs fine for me, here's is what I did...



Obviously, I've used my own graphic file, and I put in the end statement to keep the program from falling through to the function. What happens when you run your code?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Feb 2010 16:30 Edited at: 12th Feb 2010 16:32
Simply pass the name of the image to the function, along with the image number and the X and Y position you want the image to be placed.

Not sure, but the way DBP works with Sync is slightly different to DBC (what I am used to), so you probably shouldn't be using Sync Off inside the function and missing a Sync:



TDK

Login to post a reply

Server time is: 2024-11-23 19:47:45
Your offset time is: 2024-11-23 19:47:45