Serious Runtime problem

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 74
Joined: Sat Apr 17, 2010 9:21 am

Serious Runtime problem

Post by Rob van der Sloot » Thu Mar 07, 2019 12:44 pm

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.
Attachments
DBName.png

Klaus
Posts: 11966
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Serious Runtime problem

Post by Klaus » Thu Mar 07, 2019 12:48 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6924
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Serious Runtime problem

Post by dunbarx » Thu Mar 07, 2019 2:50 pm

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

Klaus
Posts: 11966
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Serious Runtime problem

Post by Klaus » Thu Mar 07, 2019 3:05 pm

It is obviously a literal, didn't you notice the QUOTES?

Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 74
Joined: Sat Apr 17, 2010 9:21 am

Re: Serious Runtime problem

Post by Rob van der Sloot » Thu Mar 07, 2019 3:14 pm

Hi Klaus,

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

thanks
Rob

Klaus
Posts: 11966
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Serious Runtime problem

Post by Klaus » Thu Mar 07, 2019 3:19 pm

OK, you got my mail address, just send it over to me with some instructions.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6924
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Serious Runtime problem

Post by dunbarx » Thu Mar 07, 2019 3:35 pm

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

Klaus
Posts: 11966
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Serious Runtime problem

Post by Klaus » Thu Mar 07, 2019 3:49 pm

If it is in QUOTES, it cannot be a variable (except in a DO statement)! :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6924
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Serious Runtime problem

Post by dunbarx » Thu Mar 07, 2019 6:52 pm

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

Klaus
Posts: 11966
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Serious Runtime problem

Post by Klaus » Fri Mar 08, 2019 3:08 pm

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

sphere
Posts: 1086
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Serious Runtime problem

Post by sphere » Mon Mar 11, 2019 1:15 pm

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.

Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 74
Joined: Sat Apr 17, 2010 9:21 am

Re: Serious Runtime problem

Post by Rob van der Sloot » Tue Mar 12, 2019 1:29 pm

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

sphere
Posts: 1086
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Serious Runtime problem

Post by sphere » Tue Mar 12, 2019 1:48 pm

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.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”