Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Runtime Error ?:0: Compare Number With Nil
Started by bvagdas Mar 15 2013 12:08 AM

3 replies to this topic
runtime error compare nil
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bvagdas

[GLOBAL: userInfoPane.html]
bvagdas
  • Enthusiast

  • 90 posts
  • Corona SDK

Hello..

 

I have a strange error for more than a month.. The error says this : Runtime error ?:0: compare number with nil.

I dont know what the hell is that.. I am very disapointed because i have the same error from 2013.1008 version and then.. I  had submit a bug report . After the 1053 build corona said that this is fixed.. But when i tested the new version, i had the same problem.. Nothing gone well.. This error i think is generated when i insert a widget button inside of a scroview element. I am using the windows version of corona.

I have attached the error below.

 

Help would be apreciated!

 

HERE is some sample code...

function scene:createScene( event )
    local group = self.view
bg = display.newImageRect("coffeeBg.png",320,480)
bg.x = display.contentWidth/2
bg.y = display.contentHeight/2
 group:insert(bg);

 local scrollView = widget.newScrollView{
 top = 5,
    width = 320,
    height = 430,
    scrollWidth = 320,
    scrollHeight = 430,
    hideBackground=true,
    verticalScrollDisabled = true,
    horizontalScrollDisabled= false,
    maskFile="mask1.png"
}


local function handleButton_hotel( event )
    local phase = event.phase
   local target = event.target
      if ( "began" == phase ) then
      print( target.id .. " pressed" )
      target:setLabel( "Pressed" )  --set a new label
   elseif ( "ended" == phase ) then
      print( target.id .. " released" )
      target:setLabel( target.baseLabel )       --reset the label
      storyboard.gotoScene("scenetemplate1");
   end
   return true

end


local hotel = widget.newButton
{
    left = 10,
    top = 195,
    width = 136,
    height = 208,
    defaultFile = "hotel.jpg",
    overFile = "hotel_.jpg",
    id = "button_1",
    onEvent = handleButton_hotel
}
scrollView:insert(hotel);
group:insert(scrollView);
    
end

Attached Files



[TOPIC: post.html]
#2

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Hi. 
 

I tested this on the mac simulator and couldn't reproduce the issue with 1054.



[TOPIC: post.html]
#3

thassman

[GLOBAL: userInfoPane.html]
thassman
  • Enthusiast

  • 63 posts
  • Corona SDK

I get it as well on 1054

insert a few large widget buttons with defaultFile and overFile defined in a horisontal only scrollview.

Then scroll the scrollview starting with the scroll on one of the buttons, then sometimes the error comes, not everytime but often enough to be a problem.

Also the scrollview wont scroll all the way to the left, leaving content that cant be reached.



[TOPIC: post.html]
#4

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

I get it as well on 1054

insert a few large widget buttons with defaultFile and overFile defined in a horisontal only scrollview.

Then scroll the scrollview starting with the scroll on one of the buttons, then sometimes the error comes, not everytime but often enough to be a problem.

Also the scrollview wont scroll all the way to the left, leaving content that cant be reached.

 

I tested this following your instructions and can't reproduce it. I tried and tried.




[topic_controls]
[/topic_controls]