Serious Runtime problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Serious Runtime problem
I have a serious runtime problem. In the runtime one script is not behaving as in the IDE.
The script is about inserting records in the database, for that I specify the global:tSQL and the global: tDBName
So I have a simple line in the script: put "mamsdocument" into tDBName.
In the IDE version the script is running as it should, no problem at all, but in the runtime version it is totally different.
In the runtime tDBName gets another value "mamsview", which is another database name.
This "mamsview" database also exists, but is not used at all in this proces.
So "mamsview" is coming from somewhere, but I can't find it.
I have put the whole script from the card level to the substack level, and then also to the main stack level
But when the script is running the line: " put "mamsdocument" into tDBName " is not effected.
"mamsview" stays in the global tDBName
The consequence is that no record is created in the database.
I have many other scripts communicating with the MySQL database and there I have no problem at all.
I have also looked into all the views, and there was one which was giving an error. So I replaced that with a new one. But it had no effect.
The script is about inserting records in the database, for that I specify the global:tSQL and the global: tDBName
So I have a simple line in the script: put "mamsdocument" into tDBName.
In the IDE version the script is running as it should, no problem at all, but in the runtime version it is totally different.
In the runtime tDBName gets another value "mamsview", which is another database name.
This "mamsview" database also exists, but is not used at all in this proces.
So "mamsview" is coming from somewhere, but I can't find it.
I have put the whole script from the card level to the substack level, and then also to the main stack level
But when the script is running the line: " put "mamsdocument" into tDBName " is not effected.
"mamsview" stays in the global tDBName
The consequence is that no record is created in the database.
I have many other scripts communicating with the MySQL database and there I have no problem at all.
I have also looked into all the views, and there was one which was giving an error. So I replaced that with a new one. But it had no effect.
Re: Serious Runtime problem
Dag Rob,
I am sure you did in fact declare tDBName as GLOBAL at the top of that script, right?
If that is the case, I would need to take a look at the complete script or stack.
Best
Klaus
I am sure you did in fact declare tDBName as GLOBAL at the top of that script, right?
If that is the case, I would need to take a look at the complete script or stack.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Serious Runtime problem
No idea what is happening here, but is mamsdocument a variable name or a literal? It had better be a literal, right?the line: " put "mamsdocument" into tDBName " is not effected.
Craig Newman
Re: Serious Runtime problem
It is obviously a literal, didn't you notice the QUOTES?
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Re: Serious Runtime problem
Hi Klaus,
It would be very helpfull if you could have a look at the whole scripting.
thanks
Rob
It would be very helpfull if you could have a look at the whole scripting.
thanks
Rob
Re: Serious Runtime problem
OK, you got my mail address, just send it over to me with some instructions.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Serious Runtime problem
It is obviously a literal, didn't you notice the QUOTES?
Klaus, my friend. Yes, I did. That is why I asked the question, to make sure.It had better be a literal, right?
Craig
Re: Serious Runtime problem
If it is in QUOTES, it cannot be a variable (except in a DO statement)!
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Serious Runtime problem
Klaus.
I know. Not my first rodeo.
I was just checking to make sure that the quotes were not there in error, loading a literal instead of some other data.
Just checking to make sure, you see.
Craig
I know. Not my first rodeo.
I was just checking to make sure that the quotes were not there in error, loading a literal instead of some other data.
Just checking to make sure, you see.
Craig
Re: Serious Runtime problem
Hi all,
FYI, I have checked that stack(s), couldn't find anything wrong and decided that this must be one of these unexplainable "temporary glitches" (a.k.a. gremlins) that are very rare but existent.
This does NOT happen in the IDE, only in the standalone and affects only ONE script of many scripts that access/modify that global variable!? Too funky!
Best
Klaus
FYI, I have checked that stack(s), couldn't find anything wrong and decided that this must be one of these unexplainable "temporary glitches" (a.k.a. gremlins) that are very rare but existent.
This does NOT happen in the IDE, only in the standalone and affects only ONE script of many scripts that access/modify that global variable!? Too funky!
Best
Klaus
Re: Serious Runtime problem
Maybe it's not hard, but should a global not begin with a g instead of a t.
So at least you know when it is a local or a global when scripting and not get confused.
So at least you know when it is a local or a global when scripting and not get confused.
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Re: Serious Runtime problem
I worked the whole thing around.
took the handler out of the button which was launching it.
Put it in another button, lateron in the proces, and now it works as it should, thank God.
I sometimes use the g as first letter of a global, to distinquish from a local, but I have never found any problems using the t as first letter of a global.
Thanks for the support,
All the best,
Rob
took the handler out of the button which was launching it.
Put it in another button, lateron in the proces, and now it works as it should, thank God.
I sometimes use the g as first letter of a global, to distinquish from a local, but I have never found any problems using the t as first letter of a global.
Thanks for the support,
All the best,
Rob
Re: Serious Runtime problem
It won't give problems i'm sure.
But it's easier to remember to use g for globals, t for locals, k for constants and s for scriptlocals (to use between handlers in a script) so don't get "in de war". As i had one time not figering out why a global did not work...i've putted it after the word local instead of global.
But of course in LC you're free to do as you please.
But it's easier to remember to use g for globals, t for locals, k for constants and s for scriptlocals (to use between handlers in a script) so don't get "in de war". As i had one time not figering out why a global did not work...i've putted it after the word local instead of global.
But of course in LC you're free to do as you please.