Page 1 of 1

Serious Runtime problem

Posted: Thu Mar 07, 2019 12:44 pm
by Rob van der Sloot
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.

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 12:48 pm
by Klaus
Dag Rob,

I am sure you did in fact declare tDBName as GLOBAL at the top of that script, right? 8)
If that is the case, I would need to take a look at the complete script or stack.


Best

Klaus

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 2:50 pm
by dunbarx
the line: " put "mamsdocument" into tDBName " is not effected.
No idea what is happening here, but is mamsdocument a variable name or a literal? It had better be a literal, right?

Craig Newman

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 3:05 pm
by Klaus
It is obviously a literal, didn't you notice the QUOTES?

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 3:14 pm
by Rob van der Sloot
Hi Klaus,

It would be very helpfull if you could have a look at the whole scripting.

thanks
Rob

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 3:19 pm
by Klaus
OK, you got my mail address, just send it over to me with some instructions.

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 3:35 pm
by dunbarx
It is obviously a literal, didn't you notice the QUOTES?
It had better be a literal, right?
Klaus, my friend. Yes, I did. That is why I asked the question, to make sure. 8)

Craig

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 3:49 pm
by Klaus
If it is in QUOTES, it cannot be a variable (except in a DO statement)! :D

Re: Serious Runtime problem

Posted: Thu Mar 07, 2019 6:52 pm
by dunbarx
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. 8)

Craig

Re: Serious Runtime problem

Posted: Fri Mar 08, 2019 3:08 pm
by Klaus
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! 8)


Best

Klaus

Re: Serious Runtime problem

Posted: Mon Mar 11, 2019 1:15 pm
by sphere
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.

Re: Serious Runtime problem

Posted: Tue Mar 12, 2019 1:29 pm
by Rob van der Sloot
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

Re: Serious Runtime problem

Posted: Tue Mar 12, 2019 1:48 pm
by sphere
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.