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

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

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Making an array Public

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-25-2009, 09:52 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 Making an array Public

Hi

My question is simple, but I just can't find the answer...

I need to make an arry public so that I can use it from another module...

I've tried a few variations on the declaration but no result but error...
__________________
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!
Reply With Quote
  #2 (permalink)  
Old 09-25-2009, 10:24 PM
Basic4ppc Veteran
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 271
Awards Showcase
Beta Tester 
Total Awards: 1
Default

In the Globals Sub of the Main module, does it work to change the 'Dim' to 'Public'?
Reply With Quote
  #3 (permalink)  
Old 09-25-2009, 10:39 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

I did not tryed that as the lack of the dim keywor meake the array not to be created...
I got a workaround working...... I added an ArrayList Control, and as controls are always public, I can now access it...

But the question is still valid...
__________________
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!
Reply With Quote
  #4 (permalink)  
Old 09-26-2009, 06:01 AM
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,
You can declare the array in the Sub Globals of any module like:
Code:
<font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">Sub </font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">Globals</font></font>
</font></font><font face=
"Courier New"><font size="2"><font color="#008000"><font face="Courier New"><font size="2"><font color="#008000"><font face="Courier New"><font size="2"><font color="#008000">'Declare the global variables here.</font></font></font>
</font></font></font></font></font></font><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff"><font face="Courier New"><font size="2"><font color="#0000ff">Public</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2"> TextG(</font></font></font></font><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080"><font face="Courier New"><font size="2"><font color="#800080">30</font></font></font></font></font></font></font></font></font><font face="Courier New"><font size="2"><font face="Courier New"><font size="2">)</font></font></font></font>
In the same module where the array is declared you can use the array like TextG(12).
Outsides the module you must use ModuleName.TextG(12)

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide

Last edited by klaus : 09-26-2009 at 06:04 AM.
Reply With Quote
  #5 (permalink)  
Old 09-26-2009, 06:50 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

Hi klaus

I did try that and it didn't work....Have you actually tryed it?
__________________
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!
Reply With Quote
  #6 (permalink)  
Old 09-27-2009, 09:41 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

It has always worked for me. You are doing as Klaus said aren't you?
Quote:
Outsides the module you must use ModuleName.TextG(12)
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #7 (permalink)  
Old 09-27-2009, 05:16 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

Ho Paulo,

For shure I am using it. You can have a look in this program: http://www.basic4ppc.com/forum/share...tructures.html

Public TextG(30) is defined in the Setup Module.

and is used in other modules like: Setup.TextG(12)

Could you post your code so we can look at it and see what is wrong or strange.

Attached a small example program.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #8 (permalink)  
Old 09-28-2009, 12:18 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

Thanks Klaus and Andrew, I trust you findings...But as i posted before, I managed to workaround in a somewhat more pratical way using the AddArrayList 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!
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
Public Events Cableguy Basic4ppc Wishlist 2 01-04-2009 09:10 PM
Initializing global public variables corwin42 Beta Versions 1 08-27-2008 12:52 PM
making more fast gjoisa Questions (Windows Mobile) 2 07-18-2008 08:23 AM
Get External IP (public IP) maXim Code Samples & Tips 1 05-23-2008 08:09 AM
Get External IP (public) maXim Italian Forum 1 05-20-2008 03:55 PM


All times are GMT. The time now is 10:29 AM.


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