Getting an execution error message with the following code.  Can anyone help?  Thank you in advance.
( execution error at line 153 (Handler: can't find handler) near "mobileControlCreate", char 1)
on addComment pQuestion,pComment -- param is full text of question line; pComment is empty for a new comment
  if isMobile() and "usernote" is among the lines of mobileControls() then
    mobileControlDelete "usernote"
  end if 
  resizeNoteGrp
  set the cCurQ of grc "usernote" to pQuestion
  show grp "noteEntry"
  put calcInputControlPadding(10) into tInputRect -- resize for margins
---------->mobileControlCreate "multiline","usernote"
  mobileControlSet "usernote","rect", tInputRect -- the rect of grc "usernote"
  mobileControlSet "usernote","opaque",false
  mobileControlSet "usernote","fontsize",the effective textsize of fld "questionsList"
  mobileControlSet "usernote","visible","true"
  if the platform = "iPhone" then
    mobileControlSet "usernote","backgroundcolor","255,255,255,0" -- transparent
  end if
  if pComment <> "" then
    replace numToChar(11) with cr in pComment -- replace soft breaks with returns
    mobileControlSet "usernote","text",pComment
  end if
end addComment
			
			
									
									
						mobilecontrolcreate problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
- 
				LiveCode_Panos
- Livecode Staff Member 
- Posts: 866
- Joined: Fri Feb 06, 2015 4:03 pm
Re: mobilecontrolcreate problem
Hi petero,
The mobileControlCreate command is for mobile only, so it will throw this error on Desktop when this line is executed.
You'll have to do something like:
as you did previously with mobileControlDelete.
Best,
Panos
--
			
			
									
									
						The mobileControlCreate command is for mobile only, so it will throw this error on Desktop when this line is executed.
You'll have to do something like:
Code: Select all
if isMobile() then
   mobileControlCreate ...
end ifBest,
Panos
--
petero
If developing on my desktop, what is the best way to test whether the field will actually scroll?  It doesn't scroll in run mode.  Will it scroll if I test in the simulator (maybe using arrow keys)?  Do I have to deploy a test version to my device to test the scrolling?  Thanks for you response, it was very helpful.
			
			
									
									
						- 
				LiveCode_Panos
- Livecode Staff Member 
- Posts: 866
- Joined: Fri Feb 06, 2015 4:03 pm
Re: mobilecontrolcreate problem
Yes, you will be able to test the scroll of the mobile field in the simulator. You can use the mouse (hold and drag) to scroll in the simulator.
You might find this lesson useful:
http://lessons.livecode.com/m/4069/l/94 ... ll-a-field
Best regards,
Panos
--
			
			
									
									
						You might find this lesson useful:
http://lessons.livecode.com/m/4069/l/94 ... ll-a-field
Best regards,
Panos
--
