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.

Same code runs OK on desktop, but not on the device.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-21-2008, 04:57 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 Same code runs OK on desktop, but not on the device.

So I'm about 75% done on my current app, and my vacations have ended, so at work i use mostly my device to code..
My project works fine on the desktop, but in the device I get an error, with no specific descripton...
I can't figure out whts wrong, but if I comment the problematic lines, wich have to do with a small 6 itens array, the Ide just won't close after a run command...
I use only 2 DLLs in my project both compatible with device/desktop usage...

Is this a bug, or am I missing something?

Here is my project,only the englis text file has ALL the menus texts...Other are dummies, and the russian file is missing because it would zip...
__________________
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 07-21-2008, 07:30 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

What problems do you encounter?
You should not put AppClose in Main_Close as AppClose calls Main_Close again.
Reply With Quote
  #3 (permalink)  
Old 07-21-2008, 07:35 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 get an error on the device on the line
Code:
 Control("imgBtn" & x +1,ImageButton).image = AppPath & "\" & Flag(x)
But only in the device...
App close so far presents no problem...
Please notice that most code is in the codefile.txt...
__________________
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 07-22-2008, 06:09 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The problem is in sub LoadINI.
You should replace all the Flag(0) = ... lines to:
Code:
For i = 0 To 5
        b = FileRead(c1)
        Flag(i) = SubString(b,StrIndexOf(b,
"=",0)+1,StrLength(b)-StrIndexOf(b,"=",0)<b><font color="Red">-1</font></b>)
Next
You've set the length to be one character longer than it should be.
So a trailing space was added to Flag(i).
Reply With Quote
  #5 (permalink)  
Old 07-22-2008, 06:54 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

I almost lost my sleep tonight trying to figure out what was wrong and that pop up as one of the possible reasons, but why doesnt affect the execution on the desktop?..
__________________
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 07-22-2008, 11:19 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
Originally Posted by Cableguy View Post
I almost lost my sleep tonight trying to figure out what was wrong and that pop up as one of the possible reasons, but why doesnt affect the execution on the desktop?..
Many problems are solved after a good night sleep.
I guess that the system API on the desktop can handle this extra space character and the device can't.
Reply With Quote
  #7 (permalink)  
Old 07-22-2008, 08:24 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

Again, it runs on the desktop but not on the device.....

From the begining...
Tap menu -> New...Defaul.INI Node is created...
Select default.INI, Tap&Hold, till context menu apears....
Add several Items to the "File"...
Now let's delete One...
Select one, tap&hold and select delete..
when promted, choose Yes...
On the desktop, the chosen node is deleted, with no problems, but in the device it errors and once again, I don't se why...(?)


PS:@ EREL
Perhaps this should be mooved to the Question forum instead...
Thanks
__________________
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
  #8 (permalink)  
Old 07-22-2008, 09:20 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,

to get the delete going on the device you have to change the following statements (case "9" of the context handling) in your codefile.txt to:
Code:
    Case "9"
    
If Msgbox(Txt(27),Txt(28),cMsgboxYesNo,cMsgBoxQuestion) = cYes Then
        
IF Node.IsRoot Then
        TreeView.RemoveNode(Node.Value)
        
Else
        Parent.Value = Node.Parent
        Parent.RemoveNode(Node.Value)
        
End If
    
Else
        
Return
    
End If
As I already mentioned, the treeview works very different on the desktop and on the device.
On the desktop "TreeView.RemoveNode" works for all nodes belonging to the whole tree. On the device you have to handle the differences between "TreeView.RemoveNode" and "Node.RemoveNode" manually. Only root nodes can be removed with "TreeView.RemoveNode". For all other (sub)nodes you have to use "Node.RemoveNode".


specci48
Reply With Quote
  #9 (permalink)  
Old 07-22-2008, 09:24 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 Specci...
__________________
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
Using rapi from desktop to copy file from device to desktop sunnyboyj Questions (Windows Mobile) 19 10-27-2010 01:08 PM
Application runs Full screen on device but no keyboard mozaharul Questions (Windows Mobile) 2 08-14-2008 10:44 AM
When compiling for Device, Desktop code is used Woinowski Bug Reports 6 07-03-2008 09:30 PM
Source Code Folders On The Device RandomCoder Basic4ppc Wishlist 13 03-23-2008 01:01 PM
Desktop Version - Design and Code at the same time sloopa Basic4ppc Wishlist 2 05-08-2007 05:55 PM


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


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