|
Post by turbov21 on Oct 10, 2007 19:37:22 GMT -5
Here's what I'm using:
[start] cls textarea #text, "" print "" link #tb, "Sumbit", [show text] wait
[show text] cls text$ = #text contents$() html "<p>" + text$ + "</p>" link #st, "Once more", [start] wait
Here's what I'm getting:
[glow=red,2,300]Runtime Error: text$ = #text contents$() Invalid handle: #text[/glow]
It fails when my handle is #text, #txa, and just #tx. I've looked at the blogCSS code, and thought I was using it in the same manner.
|
|
|
Post by Janet on Oct 10, 2007 20:11:19 GMT -5
Move your cls statement to after the
text$ = #text contents$()
instead of before.
You are effectively erasing the textarea and then trying to retrieve the contents of it. It's no longer there.
|
|
|
Post by Jerry Muelver on Oct 10, 2007 20:18:09 GMT -5
Try this: [start] cls textarea #text, "" print "" link #tb, "Sumbit", [show text] wait
[show text] 'cls text$ = #text contents$() html "<p>" + text$ + "</p>" link #st, "Once more", [start] wait
For some reason, RB doesn't like the CLS in the branch.
|
|
|
Post by carlgundel on Oct 10, 2007 20:38:17 GMT -5
That's because when you clear the screen you are getting rid of the widget. It no longer exists.
-Carl
|
|
|
Post by Jerry Muelver on Oct 10, 2007 20:57:05 GMT -5
Hugely, enormously valuable lesson learned! I was working out the CLS problem while Janet was answering, and never saw her explanation until I came back just now. This is VERY interesting, and will solve a number of problems for me even before they have a chance to occur!
|
|
|
Post by Janet on Oct 10, 2007 21:56:52 GMT -5
In turbov21's code, I'm curious about
[show text]
Run BASIC seems to accept the branch label just fine. LB4.x would balk for sure. I checked the RB help file, and sure enough, spaces are allowed and documented. Handy to know.
|
|
|
Post by turbov21 on Oct 10, 2007 22:41:17 GMT -5
You are effectively erasing the textarea and then trying to retrieve the contents of it. It's no longer there. Thanks!
|
|