Jump to content

Function Call


The Cartooners

Recommended Posts

I have created a function as listed below by editing the lua file within Notepad.

 

function SaveGame()

cartUphillChallenge:RequestSync()

Wherigo.ShowScreen(Wherigo.MAINSCREEN)

Wherigo.MessageBox{Text=[[Your game has been saved.]],}

end

 

Then I created an event named Save.

 

I then went back into Notepad and added SaveGame() to the event.

 

Tools > View Parse Errors now displays 1 parse error preventing me from publishing to my machine.

 

Question: What have I done wrong and how do I get rid of the parsing error?

 

Thanks in advance.

Link to comment

You can either move your calling function into the authors area as suggested in another repsonse or, if you don't want to do that, you can try creating a dummy variable ("dummy" say) and inserting the code

dummy = function()

into your builder managed function. The function will get executed and you never need to use the value of "dummy"

 

This has worked for me so far.

 

It seems that the builder assumes that functions are intended to return values rather than simply have sideeffects, thereby proving that "assume" is making an "a**" out of "u" and "me" :)

 

(oh isn't that bizarre - this forum replacess the two "s"s in removespaces("a s s") with stars - aren't we just so PC. I wonder what it does with "arse" - apparently nothing - good job we are not discussing zoological topics about quadripeds ;) )

Link to comment

oh isn't that bizarre - this forum replacess the two "s"s with stars.

That's because this is a family-friendly forum. Kids can learn swearing from other places (too many), so we really don't need to have it here.

 

As a moderator, I'll also request any serious discussion or critiquing on the matter of the automatic swear word replacement feature be placed in one of the General Geocaching Discussions forums, wherever seems appropriate. This same feature, by the way, is also used to correct common misspellings of "Wherigo", so it's not all bad. Personally, I felt guilty about both editing and not someone's forum post when "Wherigo" was misspelled. I ended up leaving them alone out of courtesy.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...