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 / making create_object function...

Author
Message
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 31st Aug 2008 19:51
I was thinking it over and I came up to sth like that
firstly define the type



and then I'd need a function like this



but, the problem is, i want objectID to be "object+ID", example, if I would call function



I want the function to run like this



Soo.. How can I make a variable by having a string and another variable? (in other words - Object1 created from "Object" and ID when ID=1 ). heelp..
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 31st Aug 2008 23:35
You can't do it that way, you must use an array.
This code shows how to use an array in order to store data of different objects :


Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 1st Sep 2008 00:00 Edited at: 1st Sep 2008 00:02
You have no idea how thankful I am Thank you so much for explaining this!
HWT
19
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 1st Sep 2008 17:20
FYI: Functions don't interact with the rest of the program's variables because it uses it's own "private" variables. So functions are like small programs within programs. If you want to make your variables accessible to the rest of the program you have to declare them globally at the beginning of the program as so:
Global thisisavariable as Integer
Notice you need to specify the type of data too. Check the DBpro help files.

Hope I wasn't sounding smarty-pantyish there

Hello world tommorrow
I love to play games. I love to make games. I love games.
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 1st Sep 2008 17:31
You weren't, thanks for good advice, HWT.

Login to post a reply

Server time is: 2024-11-25 18:26:14
Your offset time is: 2024-11-25 18:26:14