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

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

Beta Versions This forum is the place to discuss issues regarding Basic4ppc beta versions.

string ?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-01-2010, 07:29 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 917
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default string ?

I got an error on this and I don't inderstand it:

Code:
direction = (tc /DtoR + 540)Mod(360)
all variables here are defined as numbers, DToR = cPI/180,
tc = ACos((Sin(s_lat)-Sin(f_lat)*Cos(d))/(Sin(d)*Cos(f_lat)))


Edit: - found it, direction was already declared as global, but still, the message text is not directing to the problem.
Attached Images
File Type: jpg gpsd.jpg (25.3 KB, 12 views)
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 03-02-2010 at 04:47 AM.
Reply With Quote
  #2 (permalink)  
Old 03-02-2010, 09:18 AM
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

I can't reproduce that error from the information given as it shouldn't matter that direction was already a global and you should get an error if you try to redeclare it as a local. It should also work whether direction was declared as a default, String or Number type. So I'm wondering what the real reason for that error is
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 03-02-2010, 12:00 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 917
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

You are right, the problem was that I had two variables named direction , one was global and the other - local.

The compiler solved some mishaps that I had with the other variable.

solved by changing the name.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #4 (permalink)  
Old 03-03-2010, 08:54 AM
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

Sory, I don't think I have made myself clear. I would be interested to see if you could reproduce that error and post the code as I don't think it should be possible, using regular variables, for that error to have occurred at compile time. If you locally redeclared a global variable you should have got a redeclaration error at compile time and if you were assigning a number to a string variable Basic4ppc should have emitted the code to convert it and you wouldn't get an error until runtime if it were not possible.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 03-03-2010, 09:06 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 917
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

I can reproduce the error:
direction is global with value ( not defined as Number)

In a sub, direction is defined (again), but as Number.
when assigning direction the error appears in compilation (I don't know what happens when running from IDE because this program can run on device only).

I checked in a simple program - when running the IDE I get error about the re-dclaration of the variable. Compilation brings up the implicit string etc.
__________________
David Erez
Ramat Hasharon, Israel
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
gps data string tremara1 Questions (Windows Mobile) 2 06-02-2009 10:04 AM
Double in blob to string? HARRY Questions (Windows Mobile) 2 12-18-2008 05:14 PM
put byte value into a string cotralis Questions (Windows Mobile) 5 09-13-2008 04:30 AM
Long String Georg Questions (Windows Mobile) 2 08-06-2008 09:20 AM
OK, next string question Stellaferox Questions (Windows Mobile) 9 06-07-2007 02:12 PM


All times are GMT. The time now is 07:58 PM.


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