FBA The Creator

The True Multiplatform PC / PocketPC Opensource Development Tool - Read Only Mode - Kept only for historical purposes - Thank you all ;)
It is currently Thu Jun 04, 2026 4:59 am

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jun 20, 2008 1:47 pm 
Offline
Tutorials Contributor
Tutorials Contributor
User avatar

Joined: Tue Jun 17, 2008 3:39 am
Posts: 59
Location: Midwest, US
The help says, "Conversely, whenever a number is used where a string is expected, the number is converted to a string, in a reasonable format." However, I've found that to not always be the case when using the string functions.

For example, this:
Code:
temp=1234
test=temp.byte(3)
debug(test)

function onmainloop()
end
gives you an error: "attempt to index global 'temp' (a number value)".

Which is right? Should I be able to use the string functions on a number, or should I need to convert a number to string first?

For now I will do what works. Thanks!


Top
   
PostPosted: Fri Jun 20, 2008 3:24 pm 
Offline
Feejo Member
Feejo Member
User avatar

Joined: Fri Mar 28, 2008 8:07 am
Posts: 64
Location: Italy
weird behaviour! it works if you "force" coercion using string concatenation operator

Code:
temp=1234
test=""..temp 
test=test.byte(3)
debug(test)


the same behaviour shows the win32 version as the picture shows

Attachment:
bug.JPG
bug.JPG [ 25.68 KiB | Viewed 6762 times ]


I suppose this bug belongs to the lua library, so the better place to post this bug is to lua support team.

_________________
Regards,

umbiomar
[email protected]


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited