delete variable

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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

delete variable

Post by chris9610 » Tue Aug 11, 2009 5:14 am

I can not seem to use this command.

The dictionary shows it as Delete Global myvar[17]

The User manual shows it as Delete Variable myvar[17]

neither seems to work for me to delete an array element.

Is this a bug?
Developing with Windows XP & Revolution 4.5

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Tue Aug 11, 2009 5:35 am

They do work fine.

Are you saying you can't do

put "hello" into myVar[17]
put myVar[17]
delete variable myVar[17]
put myVar[17]

?

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Aug 11, 2009 1:14 pm

Actually that does work in a script.

I guess my problem was that it was not working from the message box. I get:

Script compile error:
Error description: delete: bad variable expression
Developing with Windows XP & Revolution 4.5

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Tue Aug 11, 2009 1:37 pm

Try it in a button to be sure!

The message box has some "funky" issues since the last 3 or 4 versions, which still did not get fixed!


Best

Klaus

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Aug 11, 2009 6:22 pm

In a button delete variable works fine, that I tested. In the message box it still fails.

That's ok as long as it works in the script.

I am just learning runrev and I use the message box to test my script sentences. I was not aware of these issues till now.
Developing with Windows XP & Revolution 4.5

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Post by mwieder » Tue Aug 11, 2009 7:19 pm

No, it works in the message box as well. But you need to use the multi-line message box option (the second icon in the toolbar), not the single line option. The single-line option only knows about its current context, not about anything that has happened in the past. Once you've typed return, that context is gone.

Post Reply