Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Jan 27, 2010 11:27 pm   

[3.12] Local variables crashing %sql
 
Open a blank session, make an alias 'find'. Connect to your database, I use a sqlite database. In alias, enter this:

$input=%trim(%lower(%-1))
row = %sql(databasename, %concat("SELECT * FROM Mobs WHERE Name LIKE","'%",$input,"%'"))
#loop 10 { #SHOW "Title: " @row.Item("Name")
#CALL @row.Next }

Then change row to a local variable, run it and you crash.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jan 27, 2010 11:48 pm   
 
Please post questions or problems about the 3.12 BETA version to the CMUD BETA Forum. The General forum is only for the Public versions.

To answer your question, there is a known bug with using the = syntax to assign a COM variable (like the result of %sql) to variables that is causing this problem. Should be fixed in the next version.
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Thu Jan 28, 2010 2:06 am   
 
The bug isn't with using = to assign variables, what I put up works fine as it is. The issue was if you want to use local variables it crashes. If local variables aren't meant nor ever will be designed to support a com object, then so be it. I don't know otherwise so I put it up.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net