Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Really odd behavior with notecard (now LSL sees it, now it doesn't!)

Barry Moody
Registered User
Join date: 17 Dec 2006
Posts: 24
10-17-2007 17:56
I have a script that first checks for the existence of a notecard...

CODE

if (llGetInventoryType (paySplitCard) != INVENTORY_NONE)
{

bmDebugMsg ("The " + paySplitCard + " notecard exists, checking for data");

// transfer control to the getPaySplitCount state //
state getPaySplitCount;

}


This code works fine and sends the script to the getPaySplitCount state...

CODE

state getPaySplitCount
{

state_entry ()
{

bmDebugMsg ("Entering state getPaySplitCount");

bmStatusMsg ("Retrieving number of notification recipients");

bmDebugMsg ("paySplitCard = " + paySplitCard);

// get the number of lines in the itemListCard notecard//
llGetNumberOfNotecardLines (paySplitCard);

}

}


The problem I am having is that while the debug message DOES display the proper output (paySplitCard = paySplit) in the Communicate window, I then immediately get an error stating: "Couldn't find notecard paySplit". (paySplitCard is a global.)

Any ideas what's causing this?
Barry Moody
Registered User
Join date: 17 Dec 2006
Posts: 24
Found it
10-17-2007 20:35
In the wiki of all things:

If the notecard is empty, the dataserver will shout on the DEBUG_CHANNEL that the notecard does not exist. This is because until a notecard is saved for the first time, it does not exist as an asset only as an inventory placeholder (llGetInventoryKey will return NULL_KEY).

I had just thrown a blank notecard in. When I hit enter, then backspace, then saved it, it worked fine!