Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Globals issue

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-26-2008, 07:49 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default Globals issue

Hi..

In Main Globals I setup a few of them...Globals
But when I change their value within a module, the values are NOT updated...
I was under the impression that Globals were shared by all modules...
Is this a bug ?
If Not, is there any workaraound without using the return KeyWord?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!

Last edited by Cableguy : 12-26-2008 at 08:14 PM.
Reply With Quote
  #2 (permalink)  
Old 12-26-2008, 09:06 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Hi Paulo,

Just a question, did you declare the variables as Public ?
And if you use them in another module the variable name must have the module name at the beginning seperated by a dot.
If you declare a variable in the Main module like
Public TestVariable
its name is
Main.TextVariable
in the other modules.
The same rule is valid for Subroutines and Controls.

Best regards and wishes for 2009.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide

Last edited by klaus : 12-26-2008 at 09:09 PM.
Reply With Quote
  #3 (permalink)  
Old 12-26-2008, 09:13 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi Cableguy,

according to Erels description (...next-version-new-features...) every module has (per default) its own global variables. If you want to use some or all of them within all modules you have to define them as public and access them in connection with the module prefix.


specci48

edit: ups ... this answer was too slow for Klaus... ;-)

Last edited by specci48 : 12-26-2008 at 09:15 PM.
Reply With Quote
  #4 (permalink)  
Old 12-26-2008, 09:21 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Thumbs up

Yes, I tryed to make them public but I either get an index out of range or a syntax error...
I tryed using:
Code:
Public Myfile=""
Doesn't Work

IT NOW WORKS....

My mistake was to declare the variable and at the same time set its value...
THAT DOESN'T WORK
What works is to declare the variable as Public
Code:
Public MyFile
And AFTER that set its value
Code:
MyFile=""
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!

Last edited by Cableguy : 12-26-2008 at 09:35 PM. Reason: FOUND THE SOLUTION
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do While Loop issue DrStrangeLv Questions (Windows Mobile) 4 12-03-2008 04:45 PM
WVGA Issue JesseW Questions (Windows Mobile) 9 12-01-2008 05:25 AM
possible to give values to arrays in Sub Globals? Stellaferox Questions (Windows Mobile) 2 02-17-2008 12:10 PM
Retrieveimage issue Cableguy Questions (Windows Mobile) 0 06-02-2007 05:49 PM


All times are GMT. The time now is 03:33 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0