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 AppGameKit Corner / #Include command usage to keep Functions in a Library

Author
Message
Zolarius
12
Years of Service
User Offline
Joined: 8th Jul 2007
Location: Vancouver, WA USA
Posted: 12th Feb 2015 17:31
Hey there, been trying to follow the book example of the #includecommand. The example does not show how it should look in the IDE or how to make the IDE link to the correct file location. What I want.

Cards
|
+---Main
+---Setup

Funtions_Lib
|
+---Main

I then need to make sure that any function I write will get called
properly inside cards.

Since I have only been working with AGK2.0.1.1 for a couple of days it has been a bit confusing attempting to adjust from DBPro.
I like it better, but there have been changes I am struggling with solving.

When Emailing me, Please start subject with: TGC-
I have an autosort feature that puts good emails
in their own folders. Thank You
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Feb 2015 18:57 Edited at: 12th Feb 2015 18:58
Usually, the primary project file is called main.agc, but perhaps you have changed it to cards.agc.

In this primary file at the top, write the following line:

#include "Functions_Lib.agc"

This is a relative path, relative the the project AppGameKit file (which should be in the same folder as main.agc / cards.agc). So if you have created an includes subfolder (like I do) then use:

#include "includes\Functions_Lib.agc"

When compiling, AppGameKit treats this as one big file. So all of your functions will be called correctly, you don't need to do anything special.

Quote: "it has been a bit confusing attempting to adjust from DBPro"


This feeling is temporary, in a week or so you will speak fluent AppGameKit!

Quidquid latine dictum sit, altum sonatur
Zolarius
12
Years of Service
User Offline
Joined: 8th Jul 2007
Location: Vancouver, WA USA
Posted: 12th Feb 2015 21:07
Thanks for the reply. I did figure it out about 2 hours ago.
I still think a better example could be put in the HELP File. I would submit, but I couldn't find the command in the commands menu. It was in the version 1 list.

Anyway, my solution was to 'Add a file' and save it with the desired name. It still didn't work! So, I went to the folder and noticed it had a other than .agc extension. Renamed the file properly and went back to the IDE and saved my work. It prompted me about the file being incorrect and asked if I wanted to resave it. Said yes, and all was well. Hopefully, this won't be the case next time!

Thanks Zolarius

When Emailing me, Please start subject with: TGC-
I have an autosort feature that puts good emails
in their own folders. Thank You
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Feb 2015 21:18
I've noticed that you have to manually add .agc to the end of new file names.

Quidquid latine dictum sit, altum sonatur

Login to post a reply

Server time is: 2019-08-21 12:10:28
Your offset time is: 2019-08-21 12:10:28