New topic: Declare public variable just for Windows
<http://forums.realsoftware.com/viewtopic.php?t=37964> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message grechcj Post subject: Declare public variable just for WindowsPosted: Sun Mar 06, 2011 4:20 am Joined: Sun Feb 14, 2010 11:19 pm Posts: 84 Location: Australia I have made a multi-platform app in RB but I only need the Windows version to update a MS Access database to RS db format. I have coded it and it works in Windows but the whole program crashes on startup in Linux. A problem which I haven't been able to find a solution for - viewtopic.php?f=8&t=36881 But from the error message I know it has something to do with the declaration of an ODBC database. I want the ODBC connection to be a public property but not affect Linux. Is there a way to declare it or enter it so? .. Code:#If (TargetWin32) then ... Top jefftullin Post subject: Re: Declare public variable just for WindowsPosted: Sun Mar 06, 2011 5:16 am Joined: Wed Nov 15, 2006 3:50 pm Posts: 2173 Location: England Put the variable in a module, wrapped up in the #if you quoted, instead of making it a property of the app or a window It wont compile into a Linux build. Of course, you need to wrap all references to it in a similar way. Top grechcj Post subject: Re: Declare public variable just for WindowsPosted: Sun Mar 06, 2011 5:49 am Joined: Sun Feb 14, 2010 11:19 pm Posts: 84 Location: Australia jefftullin wrote:Put the variable in a module, wrapped up in the #if you quoted, instead of making it a property of the app or a window... I'm trying to do that but have only done it in VB eg. Public db as ODBCDatabase All my RS global variables so far have been properties at design time. It's easy and doesn't cause conflict, until now. Should I put it in a sub in a module and then call the sub just to declare? Would it still be global? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
