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.

passing a module name as a variable

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-24-2008, 07:09 AM
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 passing a module name as a variable

How can I do this?
If I want to use 1 module and its forms consist of reusable panels, wich I change the parent....How to refer to a module using a string variable, in or der to callback a public sub from that module, commom to all modules...
If there's not yet a Keyword for it, it probably would be a good time to add a "Module(string)" 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
  #2 (permalink)  
Old 10-24-2008, 07:19 AM
Basic4ppc Veteran
 
Join Date: Sep 2008
Location: Brisbane, Australia
Posts: 317
Default not sure exactly what you're saying

but I'll try.

In my taxi app i use "Shifts.frmShifts" and that works where code requires the form in the Shifts module. I have a panel on frmShifts that I use on 2 other forms. Here is a menu click sub that changes the parent of the panel then runs a sub in Utils that sets up the data on the panel and finally brings it to the front and makes it visible.

Sub mnuShiftStatsEdit_Click
flibFareEdit.ChangeParent("shifts.pnlShiftStats"," frmFareEdit")
utils.CalcShiftStats
shifts.pnlShiftStats.Visible=True
shifts.pnlShiftStats.BringToFront
End Sub

I hope this might help you.

regards, Ricky
Reply With Quote
  #3 (permalink)  
Old 10-24-2008, 09:05 AM
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

That works if you hard code the module name, but I want to pass it as a variable, in a string...

Control(modulename).modulesub does not work...
__________________
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 10-24-2008, 09:35 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should use:
Code:
CallSub(ModuleName & "." & subName)
You can see an example of using a callback sub in the FolderChooser sample (c:\Program Files\Anywhere Software\Basic4ppc Desktop\Samples).
Reply With Quote
  #5 (permalink)  
Old 10-24-2008, 09:47 AM
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

Quote:
Originally Posted by Erel View Post
You should use:
Code:
CallSub(ModuleName & "." & subName)
You can see an example of using a callback sub in the FolderChooser sample (c:\Program Files\Anywhere Software\Basic4ppc Desktop\Samples).
I HAD FORGOTTEN ALL ABOUT CALLSUB, AS i NEVER HAD USED IT BEFORE....

BTW: MY FORMLIB PROBLEM IS SOLVED...
__________________
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 : 10-24-2008 at 10:42 AM.
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
Properties module - useful module for working with properties / ini files Erel Code Samples & Tips 2 10-13-2011 09:02 PM
Possibility of transfering variable value from one EXE to other EXE. mozaharul Questions (Windows Mobile) 3 10-16-2008 02:38 PM
Storage of module klaus Beta Versions 6 08-31-2008 02:36 PM
Dim variable c% as Double colin9876 Basic4ppc Wishlist 8 05-28-2008 01:26 PM
LoadCSV from a variable nsidney Questions (Windows Mobile) 7 01-30-2008 01:29 AM


All times are GMT. The time now is 07:52 AM.


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