One reason, in one of my scripts I have the default, state_entry event read two notecards. The reading of each notecard is encapsulated in two functions so the code pretty much looks something like this.
Function1()
{
.....
key something = llGetNotecardLine(....);
}
Function2()
{
.....
key something = llGetNotecardLine(....);
}
default
{
state_entry()
{
........
Function1()
.......
Function2()
.....
}
dataserver(....)
{
// does the actual reading/parsing here
....
}
}
The problem is, both functions are called , but the first dataserver event doesn't even kick in until after state_entry() was finished. I ended rewriting the whole thing so that the first llGetNotecardLine is called in Function1, then the whole thing goes into dataserver and handles everything else from there. However my intention and understanding was that as soon as the program goes into Function1() and makes the LLGetNoteCardLine call, the dataserver event would be triggered and afterwards, control would return to the function, which would then exit and return to state_entry.
Obviously it didn't turn out that way which immediately had me starting to bitch, but also made me ask "Do I really know anything about event driven programming?" Probably not, considering I havent much experience with languages outside of VB (and even then not really that much).
So is this how it's supposed to work? or is there something funny going on here. It looks like an event can make a function call and then return control to an event, but a function call cannot then trigger another event until the event from which it was called is finished. Is this how it's supposed to be? dataserver in my case was meant to be an event I could call multiple times to just read notecards and stuff some things into lists
