My first test result

Hello everyone, I would like to report my first experiences with livecodecreate:
I created a project and inserted on card

  1. a button on which I used the edit actions function “ask”. The automatically generated code is incorrect in the “messages” parameter which is not reported and it is necessary correct it with the edit script function
  2. I subsequently inserted a field but I was unable to set the text using the code (I get always an error)
  3. when I run the code and it fails, the project freezes and i have to unlock it, losing all the work done

I don’t know if anyone has found similar problems. A greeting.

one of the first things to hit you when moving from the desktop IDE to LC Create is that fact that all the controls are widgets. So the “field” control is not the same as as a field in the IDE but is a widget.
So you can’t put “xyz” into the field, you need to set the appropriate property of the widget
to put “wyz” into your field (called say “f1”)
set the text of widget “f1” of me to “xyz”

This is the code i inserted into a “B1” button, my scope was to update a “F1” field after an ask function. First answer is OK, second answer is OK but the dispayed text of field F1 not change (despite the text of F1 is updated). What is wrong in this code?
on mouseUp pButton
ask “What’s your name” whith “My Name”
put it into tResult
answer "Old value " & text of widget “F1”
answer "New value " & tResult
set the text of widget “F1” of me to tResult
end mouseUP

Apart from the spelling mistake the script looks fine. [you had whith not with I changed it above]
I can’t get it to work either.
with another button and field widget I can set the text, but nothing I do to your script works.
Even cutting the last line to
set the text of widget “F1” of me to “ok”
doesn’t work in your script. Weird.

There are some curly quotes. But after replacing the curly quotes it still did not work.
Finally I tried putting brackets around the answer parameters

on mouseUp pButton
   ask "What’s your name" with "My Name"
   put it into tResult
   answer "Old value " & (the text of widget "F1")
   answer "New value " & (tResult)
   set the text of widget "F1" to tResult
end mouseUp

That worked for me.
It is a bit strange but here we go

Kind regards
Bernd

[quote=

It got me too at first. It would be nice if the usual syntax was treated as a synonym for each widget. Without that, there can be no way to move projects into or out of the desktop IDE without a good deal of editing. And new users who decide to purchase a desktop license will be bewildered.

I think it is not necessary to put brackets around the parameters.

This works for me now. No idea what changed. Maybe it was a curly bracket that I overlooked.

on mouseUp pButton
   ask "What’s your name" with "My Name"
   put it into tResult
   answer "Old value " & the text of widget "F1"
   answer "New value " & tResult
   set the text of widget "F1" to tResult
end mouseUp
1 Like

The problem was the of me that was included in the widget object chunk expression (widget "F1" of me), as the widget is not a child of the button