Forum OpenACS Q&A: wierd function result

Collapse
Posted by Matthew Smith on
I am trying to write a simple function call on a XOWiki object page.
Here is what's on the page:
-----------------------------------------------------------
proc myproc {} {
return "text to display"
}

proc content {} {
set somevar [myproc]

return "$somevar"

}
-----------------------------------------------------------
This is the output I am getting:
::19493::payload

What does this mean?
Thank you.

Collapse
2: Re: wierd function result (response to 1)
Posted by Gustaf Neumann on
go the the admin page, click on the "add" column in the line with "::xowiki::Object", name the page e.g. ms, paste the program from above into the "Content", press ok.

the go e.g. the the default index page, an you will see "en:ms" as the newest created object. Click on the object, and you will see "text to display" in the content...

Collapse
3: Re: wierd function result (response to 2)
Posted by Matthew Smith on
Ok, what you suggested worked. However, I do not understand the difference between what you suggested and what I did in the first place.

Thank you for the help.

Collapse
4: Re: wierd function result (response to 2)
Posted by Matthew Smith on
Looks like I spoke too soon. Now the new script is outputting this:
::19614::payload

Here's what I did:
1. Created the new object as you suggested. That worked ok and "text to display" was displayed.
2. Went to the old object page(the original that was not working). Clicked the "edit" button then "ok".
3. Went back to the new object. That's when it began to display "::19614::payload".

Why is it doing this? What do the numbers and what does "payload" mean?

Thank you.

Collapse
5: Re: wierd function result (response to 4)
Posted by Matthew Smith on
It seems that editing the other object has nothing to do with the change.

I created a new object with the function which worked. After going in and editing that object and saving it, it started displaying the "::19620::payload".