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.

Switching between screens

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2009, 03:08 PM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 159
Default Switching between screens

Hi,
In the attached program I used two menu items to switch between screens generated at run-time. At the start the left menu option is “Close” and right option is “Next >”. Clicking the “Next >” option changes the “Close” menu option to “< Back” and at the last screen the “Next >” menu option becomes “Save” option, the left option is still “< Back”. Clicking the “< Back” option any time will take to the previous screen. The “< Back” menu option again becomes “Close” when switch back to the first screen.

The program runs fine in the desktop even in the device without using the soft keyboard. But when keyboard is used in the device then I can not move back and forth using the menu options.
The place to look for any problem is :
the “Sub Mclose_click” and “SubMnext_Click” event in the program.
I set the message and have seen that without using the keyboard on the device highest value generated for variable “m” is 2 (which is OK) but when keyboard is used and try to switch back or forth, value generated for variable “m” is more than 1000 and keeps increasing in each click of “Next >” menu option. Also tried to use hardware library (hardware_SIPchanged event) but could not make it out.

Regards,
Reply With Quote
  #2 (permalink)  
Old 01-30-2009, 03:28 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

You are using the variable m at two places in the hw_SIPChanged routine and in the Mclose_Click , Mnext_Click routines!

Are you shure that the variable m in SIPChanged is same as the other one you use in the Mclose_Click and Mnext_Click routines.

You should use another variable name in routine SIPChanged.
When you use local variables in subroutines, I suggest you to declare these with a Dim keyword at the beginning of the routine like.
Sub hw_SIPChanged
Dim mm, h

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #3 (permalink)  
Old 01-30-2009, 04:05 PM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 159
Default

Thanks for the suggestion. Since I declared the variable "m" in the global section, then if I'm not wrong, variable "m" is same used in the mentioned subs.

best regards,
Reply With Quote
  #4 (permalink)  
Old 01-30-2009, 04:13 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Yes , when you declare a variable in the global routine, it is the same for all routines in the same module.

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #5 (permalink)  
Old 01-30-2009, 04:49 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

As Klaus pointed out you seem to be using the global variable m for two different incompatible purposes. In Mnext_Click you seem to be using it as a Form progression counter but in hw_SIPChanged you are using it to hold a calculated height in pixels - this is where the big number comes from. Surely you need to use a local variable in hw_SIPChanged and not upset a global variable used for an entirely different purpose!
Reply With Quote
  #6 (permalink)  
Old 02-03-2009, 06:23 AM
Senior Member
 
Join Date: Mar 2008
Location: Dhaka, Bangladesh
Posts: 159
Default

My best regards to both of you, klaus and agraham. I'm ashamed for the silly mistake I made.
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
Working with VGA screens Erel Tutorials 29 04-30-2009 01:38 AM
Fast user switching LineCutter Questions (Windows Mobile) 0 10-27-2008 11:37 PM
PPC is hanging after switching GPS on/off BerndB Questions (Windows Mobile) 8 05-24-2008 03:39 PM
out-of-memory-error based on timer after switching to V6 Frank Questions (Windows Mobile) 2 01-17-2008 04:26 PM
Reactivate the CF GPS after switching on Scubaticus Questions (Windows Mobile) 6 10-25-2007 08:00 PM


All times are GMT. The time now is 03:11 AM.


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