debugging asp/script function in HomeSeer

smee

Senior Member
I'm debugging a combination of a script and ASP page in HomeSeer and would like to ask HomeSeer users to do me a favor.

I'm calling a function in the script from the asp page. I need to find out which versions of HomeSeer will get a return value in the asp page (if any).

I've got a script file and an asp file. I need people to save these files to their HomeSeer directories, call the asp page, and post the resulting page.

This file, return_test.txt, should go in the scripts directory under HomeSeer:
Code:
'return_test.txt
function return_data()
   return_data = "test"
end function
This file, return_test.asp, should go in the html directory under HomeSeer:
Code:
'return_test.asp
sub main(link)
dim data
   data = hs.RunEx("return_test.txt","return_data","")
   response.send "<html><body>return_test<p>"
   response.send "result = " & data & "<p>"
   response.send "</body></html>"
end sub
If you bring up this page in a browser, you should get a very simple text result. Use something like this URL (depending on how you have the HomeSeer web server set up):
Code:
http://192.168.0.100:80/return_test.asp

If you could try this and post the results, along with the version of HS you are running, I'd appreciate it.

Thanks.
 
Thanks. If anyone else wants to try this with a different version of HomeSeer, I'd appreciate it. I'm trying to find out if any version has a RunEx which will return a value. I can't get this to work from script to asp or script to script. I haven't found any discussion of it on the HS board.

I'm wondering if I'm doing something wrong or if it's a bug. I can't imagine that this hasn't come up before if it's a bug.
 
I have "solved" my problem. For those who are interested, it appears that the function being called by RunEx must have an argument in order for RunEx to get the function's return value.

This is illustrated in the following code (see the dummy argument that's not used for anything):
Code:
'return_test.txt
function return_data(dummy)
  return_data = "test"
end function
I don't know if this is a bug or just something I don't understand.

Thanks for checking the results on your systems, guys.
 
smee:

Do you have a link for the NCD AVS4x1 video switch you mentioned? I am interested in a very cheap video switcher.

Thanks,

BSR
 
Back
Top