Complete Newbie (but 25 years experience in older stuff)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
Regarding the illusive debug mode the Development - Script Debug Mode menu item is ignored in both Edit and Run mode. Ctrl - Click placing the breakpoint still results in a grey mark and nothing stops
Cheers
John
Cheers
John
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
Debug again, yes I can right click on a breakpoint and choose enable (or indeed enter a condition). However Choosing Enable does not turn debug on or enable the breakpoint. Breakpoints are greyed out and the menu item Development - Script Debug Mode does not work. I haven't been able to find anything in the docs that suggest there is a switch somewhere. There is nothing in Preferences to suggest a switch.
I am developing in Windows, could this be a Windows issue ? Maybe I should downgrade to a lessor version ?
Cheers
John
I am developing in Windows, could this be a Windows issue ? Maybe I should downgrade to a lessor version ?
Cheers
John
Re: Complete Newbie (but 25 years experience in older stuff)
I forgot to uncomment out the first line, in the post above..
Also, it's "among the items of" not "among the lines of", so that's been changed in this version..
Also, it's "among the items of" not "among the lines of", so that's been changed in this version..
Code: Select all
local sMySendCommandID
on keyDown pKey
if (sMySendCommandID is among the items of the pendingMessages) then cancel sMySendCommandID
send "MyDelayedSearch pKey" to me in 500 milliseconds
put the result into sMySendCommandID
pass keyDown
end keyDown
command MyDelayedSearch pKey
-- do your stuff here
end MyDelayedSearch
Re: Complete Newbie (but 25 years experience in older stuff)
This is also the behavior of an uncompiled script. To debug, the Debug Mode must be set in the Development menu (you can leave it on permanently, most of us never turn it off.) Then edit your script as needed, and click the Apply button at the top left of the script editor window, or just hit the Enter key on the keyboard. Then set some debug points.J&R Rovers wrote:Regarding the illusive debug mode the Development - Script Debug Mode menu item is ignored in both Edit and Run mode. Ctrl - Click placing the breakpoint still results in a grey mark and nothing stops
Cheers
John
Note that there is currently a bug in the script editor that doesn't always keep the breakpoints aligned with the correct lines of script if you edit the script with existing breakpoints in place. If that happens the breakpoints won't work as expected, so keep an eye out for wandering red dots.
However, a gray dot is a disabled breakpoint and will never trigger. If you see those it's likely the script has been changed but not yet compiled. (Or the dot has wandered into a comment where it can't be active.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
A BIG thank you all for your help.
(1) Yes the incremental search now works a treat by changing the lines to items
(2) The debugger ? All I have to do is to switch the debugger on before I load any stacks or start work and I will always leave it on. My mistake was assuming it could be switched on at will.
Hopefully I can go forward and get over the next few humps on my own.
Pretty excited and more than a little embarrassed
Cheers
John
(1) Yes the incremental search now works a treat by changing the lines to items
(2) The debugger ? All I have to do is to switch the debugger on before I load any stacks or start work and I will always leave it on. My mistake was assuming it could be switched on at will.
Hopefully I can go forward and get over the next few humps on my own.

Cheers
John
Re: Complete Newbie (but 25 years experience in older stuff)
Don't be embarrassed -- you should be able to turn debugging on and off at will. Sounds like a glitch to me. Probably no one has noticed it because we never turn it off.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Complete Newbie (but 25 years experience in older stuff)
Ditto to what Jaque said, the other big gotcha (that got me a lot) was forgetting to turn messages back on after turning it off
or getting to change the 'select grouped' box, or ...(too many other things to mention)... 



-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
Yeah, well I try to avoid finding fault with a new environment. Ask any experienced Visual Foxpro Developer. It is/was the fastest RAD system ever invented. The MVP's there were at the leading edge of everything; inheritance, intellisense, data manipulation, you name it. Even that little thing the Escape key to drop out of any window and clear the Command (Messages) box, little things but oh so great for speed of work. The previous owners had a Mac compiler as well. Then Microsoft dumped it, a great shame.
Like where the hell do I find formatting or Inputmask of a field in Livecode to be able to force upper/lower case, pictures of number formatting 99999.99 etc etc. Drives me mad.
But, and here is the rub, Livecode has multi platform support, that is EVERYTHING as far as I am concerned. So I will spend days on one small thing trying to understand the logic that escapes me, just like I did when I first moved to Object Oriented programming so often walking away to clear my head. Then coming back at all hours to try again.
Then the thrill of making something work that fires the addiction and makes it all worth while
Cheers
John
Like where the hell do I find formatting or Inputmask of a field in Livecode to be able to force upper/lower case, pictures of number formatting 99999.99 etc etc. Drives me mad.

But, and here is the rub, Livecode has multi platform support, that is EVERYTHING as far as I am concerned. So I will spend days on one small thing trying to understand the logic that escapes me, just like I did when I first moved to Object Oriented programming so often walking away to clear my head. Then coming back at all hours to try again.
Then the thrill of making something work that fires the addiction and makes it all worth while

Cheers
John
Re: Complete Newbie (but 25 years experience in older stuff)
Did you find out? Because both of these things are doable.Like where the hell do I find formatting or Inputmask of a field in Livecode to be able to force upper/lower case, pictures of number formatting 99999.99 etc etc.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
No, I have tried to use toUpper() like this
I did get a semblance of something working to a point with the code below, however that just echo's a double up. Type a and you get Aa
From what I can see we have to write most of the functionality we took for granted in other languages ourselves.
BTW although I got the debugger working, it changes it's mind (even in edit mode) and stops working even though Script Debug mode is on. To get it working again I have to close everything and open Livecode again. Not the quickest way to develop an app
Also with Background switched on to get rid of the clutter behind me and I open a stack or anything else it doesn't appear (stays hidden) until I click on the background then it shows.
But that doesn't work.on mousedown
toUpper(me)
end mousedown
I did get a semblance of something working to a point with the code below, however that just echo's a double up. Type a and you get Aa
The property inspector actually has a format checkbox, but that does nothing. I couldn't find anything under formatting that was relevant in the property inspector. There is nothing under inputmask either.on keyDown pKey
put toUpper(pKey) into the selection
if (sMySendCommandID is among the items of the pendingMessages) then cancel sMySendCommandID
send "MyDelayedSearch pKey" to me in 500 milliseconds
put the result into sMySendCommandID
pass keyDown
end keyDown
command MyDelayedSearch pKey
set the dgData of group "DataGrid1" to empty
put field "fldEntry" into myField
put "%" after myField
put "SELECT * FROM customers where customerid like " into tQuery
put "'" after tQuery
put myField after tQuery
put "'" after tQuery
put revDataFromQuery(,,gConID,tQuery) into tRecords
set the dgText of group "datagrid1" to tRecords
end MyDelayedSearch
From what I can see we have to write most of the functionality we took for granted in other languages ourselves.
BTW although I got the debugger working, it changes it's mind (even in edit mode) and stops working even though Script Debug mode is on. To get it working again I have to close everything and open Livecode again. Not the quickest way to develop an app

Also with Background switched on to get rid of the clutter behind me and I open a stack or anything else it doesn't appear (stays hidden) until I click on the background then it shows.
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
Sorry that first quote should have been
on keyDown
etc
Not on Mousedown
Cheers
John
on keyDown
etc
Not on Mousedown
Cheers
John
Re: Complete Newbie (but 25 years experience in older stuff)
You're close. KeyDown is sent before the character goes into the field, keyUp is sent after. If you don't pass KeyDown, the engine will never get a chance to process the keypress. So the reason you're getting double characters is because the handler puts the text into the field, passes the message, and the engine (which doesn't know you've handled the keypress) puts it in again. So the solution is: don't pass keyDown.
This is pretty much how we write input masks; you can capture and work with typed text in any way you want, including discarding it. For example, if you only want a field to accept numbers:
That will accept numbers and decimal points, but not alpha characters. Basic rule of thumb is that if you are handling the keypress, don't pass keyDown. Just take out that line and you should be good.
I'm glad you're sticking it out -- besides syntax and vocabulary, there is always a raft of behaviors to learn, and for me that's the hardest part. It isn't just knowing what the words are, but also what happens when you use them and how the system works.
This is pretty much how we write input masks; you can capture and work with typed text in any way you want, including discarding it. For example, if you only want a field to accept numbers:
Code: Select all
if pKey is a number or pKey is "." then
put pKey into the selection
end if
I'm glad you're sticking it out -- besides syntax and vocabulary, there is always a raft of behaviors to learn, and for me that's the hardest part. It isn't just knowing what the words are, but also what happens when you use them and how the system works.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 19
- Joined: Thu Feb 26, 2015 7:51 am
- Contact:
Re: Complete Newbie (but 25 years experience in older stuff)
That worked !
I can now see how I can create standard validations as well.
Yes the order of firing of events and even what they are will be a challenge and in some ways the simplistic commands are a bit hard to grasp, but it's what we do I guess. I was going through the lessons and came across one of yours using the debugger. Small world
Thank you for your patience. I have no doubt I will need to post other questions time goes by, but I do spend a lot of time sifting through lessons, demos and the dictionary to pick up tips and logic
Cheers
John
I can now see how I can create standard validations as well.
Yes the order of firing of events and even what they are will be a challenge and in some ways the simplistic commands are a bit hard to grasp, but it's what we do I guess. I was going through the lessons and came across one of yours using the debugger. Small world

Thank you for your patience. I have no doubt I will need to post other questions time goes by, but I do spend a lot of time sifting through lessons, demos and the dictionary to pick up tips and logic
Cheers
John
Re: Complete Newbie (but 25 years experience in older stuff)
Hi.
LC seems at first blush so easy, new users are oftentimes disappointed when they learn that considerable learning effort is required to actually do real work. That is because LC is a vast, rich environment, that, if as easy to learn as it first seemed, would not have the power and flexibility it does.
The next thing to struggle with is the fact that there are always many ways to do what you want to. As you gain experience, you will find this both enlightening and annoying. Annoying because the third way you see is (and always was) likely the best way.
For example, if you wanted to filter anything that was not a valid "number" when the user types into a field, you would need to include the minus sign. So this might be one way:
So unless you explicitly want the user to be able to include "+", this covers it.
Craig Newman
LC seems at first blush so easy, new users are oftentimes disappointed when they learn that considerable learning effort is required to actually do real work. That is because LC is a vast, rich environment, that, if as easy to learn as it first seemed, would not have the power and flexibility it does.
The next thing to struggle with is the fact that there are always many ways to do what you want to. As you gain experience, you will find this both enlightening and annoying. Annoying because the third way you see is (and always was) likely the best way.
For example, if you wanted to filter anything that was not a valid "number" when the user types into a field, you would need to include the minus sign. So this might be one way:
Code: Select all
if pKey is in "0123456789.-" then pass keyDown

Craig Newman
Re: Complete Newbie (but 25 years experience in older stuff)
So about the debugger. I've never seen that happen and have never had to restart LC. What exactly happens when it stops working?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com